Class: Garb::Management::Profile

Inherits:
Object
  • Object
show all
Extended by:
Attributes
Includes:
PathAttribute, ProfileReports
Defined in:
lib/garb/management/profile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

extended

Methods included from PathAttribute

#path

Methods included from ProfileReports

add_report_method

Constructor Details

#initialize(entry, session) ⇒ Profile

Returns a new instance of Profile.



25
26
27
28
# File 'lib/garb/management/profile.rb', line 25

def initialize(entry, session)
  @entry = entry
  @session = session
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



9
10
11
# File 'lib/garb/management/profile.rb', line 9

def session
  @session
end

Class Method Details

.all(session = Session, path = '/accounts/~all/webproperties/~all/profiles') ⇒ Object



12
13
14
15
# File 'lib/garb/management/profile.rb', line 12

def self.all(session = Session, path = '/accounts/~all/webproperties/~all/profiles')
  feed = Feed.new(session, path)
  feed.entries.map { |entry| new(entry, session) }
end

.for_account(account) ⇒ Object



17
18
19
# File 'lib/garb/management/profile.rb', line 17

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

.for_web_property(web_property) ⇒ Object



21
22
23
# File 'lib/garb/management/profile.rb', line 21

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

Instance Method Details

#goalsObject



30
31
32
# File 'lib/garb/management/profile.rb', line 30

def goals
  Goal.for_profile self
end