lib/legato/management/profile.rb in legato-0.2.0 vs lib/legato/management/profile.rb in legato-0.3.0
- old
+ new
@@ -8,30 +8,35 @@
def self.default_path
"/accounts/~all/webproperties/~all/profiles"
end
def path
- self.class.default_path + "/" + id.to_s
+ "/accounts/#{account_id}/webproperties/#{web_property_id}/profiles/#{id}"
end
- attr_accessor :id, :name, :web_property_id, :user, :attributes
+ attr_accessor :id, :name, :web_property_id, :account_id, :user, :attributes
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', 'webPropertyId'].each { |key| attributes.delete(key) }
+ ['id', 'name', 'accountId', 'webPropertyId'].each { |key| attributes.delete(key) }
self.attributes = attributes
end
def self.for_account(account)
all(account.user, account.path+'/webproperties/~all/profiles')
end
def self.for_web_property(web_property)
all(web_property.user, web_property.path+'/profiles')
+ end
+
+ def goals
+ Goal.for_profile(self)
end
end
end
end