Class: Legato::User

Inherits:
Object
  • Object
show all
Defined in:
lib/legato/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_tokenObject

Returns the value of attribute access_token.



3
4
5
# File 'lib/legato/user.rb', line 3

def access_token
  @access_token
end

#api_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/legato/user.rb', line 3

def api_key
  @api_key
end

#quota_userObject

Returns the value of attribute quota_user.



3
4
5
# File 'lib/legato/user.rb', line 3

def quota_user
  @quota_user
end

#user_ipObject

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_summaryObject



24
25
26
# File 'lib/legato/user.rb', line 24

def 
  Management::AccountSummary.all(self)
end

#accountsObject

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

#goalsObject

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

#profilesObject

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

#segmentsObject

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_propertiesObject

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