Class: Legato::Management::Goal
- Inherits:
-
Object
- Object
- Legato::Management::Goal
- Extended by:
- Finder
- Defined in:
- lib/legato/management/goal.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.
-
#profile_id ⇒ Object
Returns the value of attribute profile_id.
-
#user ⇒ Object
Returns the value of attribute user.
-
#web_property_id ⇒ Object
Returns the value of attribute web_property_id.
Class Method Summary collapse
- .default_path ⇒ Object
- .for_account(account) ⇒ Object
- .for_profile(profile) ⇒ Object
- .for_web_property(web_property) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes, user) ⇒ Goal
constructor
A new instance of Goal.
- #path ⇒ Object
Methods included from Finder
Constructor Details
#initialize(attributes, user) ⇒ Goal
Returns a new instance of Goal.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/legato/management/goal.rb', line 17 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'] self.profile_id = attributes['profileId'] ['id', 'name', 'accountId', 'webPropertyId', 'profileId'].each { |key| attributes.delete(key) } self.attributes = attributes end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def account_id @account_id end |
#attributes ⇒ Object
Returns the value of attribute attributes.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def name @name end |
#profile_id ⇒ Object
Returns the value of attribute profile_id.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def profile_id @profile_id end |
#user ⇒ Object
Returns the value of attribute user.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def user @user end |
#web_property_id ⇒ Object
Returns the value of attribute web_property_id.
15 16 17 |
# File 'lib/legato/management/goal.rb', line 15 def web_property_id @web_property_id end |
Class Method Details
.default_path ⇒ Object
7 8 9 |
# File 'lib/legato/management/goal.rb', line 7 def self.default_path "/accounts/~all/webproperties/~all/profiles/~all/goals" end |
.for_account(account) ⇒ Object
29 30 31 |
# File 'lib/legato/management/goal.rb', line 29 def self.for_account(account) all(account.user, account.path+'/webproperties/~all/profiles/~all/goals') end |
.for_profile(profile) ⇒ Object
37 38 39 |
# File 'lib/legato/management/goal.rb', line 37 def self.for_profile(profile) all(profile.user, profile.path+'/goals') end |
.for_web_property(web_property) ⇒ Object
33 34 35 |
# File 'lib/legato/management/goal.rb', line 33 def self.for_web_property(web_property) all(web_property.user, web_property.path+'/profiles/~all/goals') end |
Instance Method Details
#path ⇒ Object
11 12 13 |
# File 'lib/legato/management/goal.rb', line 11 def path self.class.default_path + "/" + id.to_s end |