Class: Dotloop::Profile
- Inherits:
-
Object
- Object
- Dotloop::Profile
- Defined in:
- lib/dotloop/profile.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #all ⇒ Object
- #find(profile_id:) ⇒ Object
-
#initialize(client:) ⇒ Profile
constructor
A new instance of Profile.
Constructor Details
#initialize(client:) ⇒ Profile
Returns a new instance of Profile.
7 8 9 |
# File 'lib/dotloop/profile.rb', line 7 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/dotloop/profile.rb', line 5 def client @client end |
Instance Method Details
#all ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/dotloop/profile.rb', line 11 def all @client.get('/profile')[:data].map do |profile_attrs| profile = Dotloop::Models::Profile.new(profile_attrs) profile.client = client profile end end |
#find(profile_id:) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/dotloop/profile.rb', line 19 def find(profile_id:) profile_attrs = @client.get("/profile/#{profile_id.to_i}")[:data] profile = Dotloop::Models::Profile.new(profile_attrs) profile.client = client profile end |