Class: Legato::Management::Profile
- Inherits:
-
Object
- Object
- Legato::Management::Profile
- Extended by:
- Finder
- Includes:
- ProfileMethods
- Defined in:
- lib/legato/management/profile.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#user ⇒ Object
Returns the value of attribute user.
-
#web_property_id ⇒ Object
Returns the value of attribute web_property_id.
Class Method Summary collapse
Instance Method Summary collapse
- #goals ⇒ Object
-
#initialize(attributes, user) ⇒ Profile
constructor
A new instance of Profile.
- #path ⇒ Object
Methods included from Finder
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.account_id = 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_id ⇒ Object
Returns the value of attribute account_id.
16 17 18 |
# File 'lib/legato/management/profile.rb', line 16 def account_id @account_id end |
#attributes ⇒ Object
Returns the value of attribute attributes.
16 17 18 |
# File 'lib/legato/management/profile.rb', line 16 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/legato/management/profile.rb', line 16 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/legato/management/profile.rb', line 16 def name @name end |
#user ⇒ Object
Returns the value of attribute user.
16 17 18 |
# File 'lib/legato/management/profile.rb', line 16 def user @user end |
#web_property_id ⇒ Object
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_path ⇒ Object
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.for_account(account) all(account.user, account.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
#goals ⇒ Object
37 38 39 |
# File 'lib/legato/management/profile.rb', line 37 def goals Goal.for_profile(self) end |
#path ⇒ Object
12 13 14 |
# File 'lib/legato/management/profile.rb', line 12 def path "/accounts/#{account_id}/webproperties/#{web_property_id}/profiles/#{id}" end |