Class: Legato::User
- Inherits:
-
Object
- Object
- Legato::User
- Defined in:
- lib/legato/user.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#quota_user ⇒ Object
Returns the value of attribute quota_user.
-
#user_ip ⇒ Object
Returns the value of attribute user_ip.
Instance Method Summary collapse
- #account_summary ⇒ Object
-
#accounts ⇒ Object
All the ‘Account` records available to this user.
-
#goals ⇒ Object
All the ‘Goal` records available to this user.
-
#initialize(token, api_key = nil) ⇒ User
constructor
A new instance of User.
-
#profiles ⇒ Object
All the ‘Profile` records available to this user.
-
#request(query) ⇒ Object
TODO: refactor into request object again.
-
#segments ⇒ Object
All the ‘Segment` records available to this user.
-
#web_properties ⇒ Object
All the ‘WebProperty` records available to this user.
Constructor Details
#initialize(token, api_key = nil) ⇒ User
Returns a new instance of User.
5 6 7 8 |
# File 'lib/legato/user.rb', line 5 def initialize(token, api_key = nil) self.access_token = token self.api_key = api_key end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/legato/user.rb', line 3 def access_token @access_token end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/legato/user.rb', line 3 def api_key @api_key end |
#quota_user ⇒ Object
Returns the value of attribute quota_user.
3 4 5 |
# File 'lib/legato/user.rb', line 3 def quota_user @quota_user end |
#user_ip ⇒ Object
Returns the value of attribute user_ip.
3 4 5 |
# File 'lib/legato/user.rb', line 3 def user_ip @user_ip end |
Instance Method Details
#account_summary ⇒ Object
24 25 26 |
# File 'lib/legato/user.rb', line 24 def account_summary Management::AccountSummary.all(self) end |
#accounts ⇒ Object
All the ‘Account` records available to this user
20 21 22 |
# File 'lib/legato/user.rb', line 20 def accounts Management::Account.all(self) end |
#goals ⇒ Object
All the ‘Goal` records available to this user
44 45 46 |
# File 'lib/legato/user.rb', line 44 def goals Management::Goal.all(self) end |
#profiles ⇒ Object
All the ‘Profile` records available to this user
34 35 36 |
# File 'lib/legato/user.rb', line 34 def profiles Management::Profile.all(self) end |
#request(query) ⇒ Object
TODO: refactor into request object again
11 12 13 14 15 |
# File 'lib/legato/user.rb', line 11 def request(query) append_quotas_to_query(query) Request.new(self, query).response end |
#segments ⇒ Object
All the ‘Segment` records available to this user
39 40 41 |
# File 'lib/legato/user.rb', line 39 def segments Management::Segment.all(self) end |
#web_properties ⇒ Object
All the ‘WebProperty` records available to this user
29 30 31 |
# File 'lib/legato/user.rb', line 29 def web_properties Management::WebProperty.all(self) end |