Class: DocusignDtr::User
- Inherits:
-
Object
- Object
- DocusignDtr::User
- Defined in:
- lib/docusign_dtr/user.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #all_by_room_id(room_id) ⇒ Object
-
#initialize(client:) ⇒ User
constructor
A new instance of User.
- #profile(user_id) ⇒ Object
- #user_info ⇒ Object
Constructor Details
#initialize(client:) ⇒ User
Returns a new instance of User.
5 6 7 |
# File 'lib/docusign_dtr/user.rb', line 5 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/docusign_dtr/user.rb', line 3 def client @client end |
Instance Method Details
#all_by_room_id(room_id) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/docusign_dtr/user.rb', line 23 def all_by_room_id(room_id) @client.get("/rooms/#{room_id}/users")['users'].map do |user_attrs| user = DocusignDtr::Models::User.new(user_attrs) user.client = client user end end |
#profile(user_id) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/docusign_dtr/user.rb', line 16 def profile(user_id) profile_attrs = @client.get("/users/#{user_id}/profile") profile = DocusignDtr::Models::Profile.new(profile_attrs) profile.client = client profile end |
#user_info ⇒ Object
9 10 11 12 13 14 |
# File 'lib/docusign_dtr/user.rb', line 9 def user_info user_attrs = @client.get('/users/user_info') user = DocusignDtr::Models::User.new(user_attrs) user.client = client user end |