Class: Legato::Management::Profile

Inherits:
Object
  • Object
show all
Extended by:
Finder
Includes:
ProfileMethods
Defined in:
lib/legato/management/profile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Finder

all, base_uri

Methods included from ProfileMethods

add_profile_method, method_name_from_klass

Constructor Details

#initialize(attributes, user) ⇒ Profile

Returns a new instance of Profile.



18
19
20
21
22
23
24
25
26
27
# File 'lib/legato/management/profile.rb', line 18

def initialize(attributes, user)
  self.user = user
  self.id = attributes['id']
  self.name = attributes['name']
  self. = attributes['accountId']
  self.web_property_id = attributes['webPropertyId']

  ['id', 'name', 'accountId', 'webPropertyId'].each { |key| attributes.delete(key) }
  self.attributes = attributes
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def 
  @account_id
end

#attributesObject

Returns the value of attribute attributes.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def attributes
  @attributes
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def id
  @id
end

#nameObject

Returns the value of attribute name.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def name
  @name
end

#userObject

Returns the value of attribute user.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def user
  @user
end

#web_property_idObject

Returns the value of attribute web_property_id.



16
17
18
# File 'lib/legato/management/profile.rb', line 16

def web_property_id
  @web_property_id
end

Class Method Details

.default_pathObject



8
9
10
# File 'lib/legato/management/profile.rb', line 8

def self.default_path
  "/accounts/~all/webproperties/~all/profiles"
end

.for_account(account) ⇒ Object



29
30
31
# File 'lib/legato/management/profile.rb', line 29

def self.()
  all(.user, .path+'/webproperties/~all/profiles')
end

.for_web_property(web_property) ⇒ Object



33
34
35
# File 'lib/legato/management/profile.rb', line 33

def self.for_web_property(web_property)
  all(web_property.user, web_property.path+'/profiles')
end

Instance Method Details

#goalsObject



37
38
39
# File 'lib/legato/management/profile.rb', line 37

def goals
  Goal.for_profile(self)
end

#pathObject



12
13
14
# File 'lib/legato/management/profile.rb', line 12

def path
  "/accounts/#{}/webproperties/#{web_property_id}/profiles/#{id}"
end