lib/legato/management/goal.rb in legato-0.6.2 vs lib/legato/management/goal.rb in legato-0.7.0
- old
+ new
@@ -10,22 +10,18 @@
def path
self.class.default_path + "/" + id.to_s
end
- attr_accessor :id, :name, :account_id, :web_property_id, :profile_id, :user, :attributes
+ GA_ATTRIBUTES = {
+ :id => 'id',
+ :name => 'name',
+ :account_id => 'accountId',
+ :web_property_id => 'webPropertyId',
+ :profile_id => 'profileId'
+ }
- 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
+ include Model
def self.for_account(account)
all(account.user, account.path+'/webproperties/~all/profiles/~all/goals')
end