Class: Legato::Management::Profile

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

Constant Summary collapse

GA_ATTRIBUTES =
{
  :id => 'id',
  :name => 'name',
  :account_id => 'accountId',
  :web_property_id => 'webPropertyId'
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Finder

all, base_uri, get

Methods included from Model

#build, included, #initialize

Methods included from ProfileMethods

add_profile_method, method_name_from_klass

Instance Attribute Details

#accountObject



35
36
37
# File 'lib/legato/management/profile.rb', line 35

def 
  @account ||= Account.from_child(self)
end

#web_propertyObject



39
40
41
# File 'lib/legato/management/profile.rb', line 39

def web_property
  @web_property ||= WebProperty.from_child(self)
end

Class Method Details

.build_from_summary(attributes, user, account, web_property) ⇒ Object



47
48
49
50
51
52
# File 'lib/legato/management/profile.rb', line 47

def self.build_from_summary(attributes, user, , web_property)
  Profile.new(attributes, user).tap { |profile|
    profile. = 
    profile.web_property = web_property
  }
end

.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



27
28
29
# File 'lib/legato/management/profile.rb', line 27

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

.for_web_property(web_property) ⇒ Object



31
32
33
# File 'lib/legato/management/profile.rb', line 31

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

Instance Method Details

#goalsObject



43
44
45
# File 'lib/legato/management/profile.rb', line 43

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