Class: Garb::Management::Goal

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

extended

Methods included from PathAttribute

#path

Constructor Details

#initialize(entry, session) ⇒ Goal

Returns a new instance of Goal.



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

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

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



7
8
9
# File 'lib/garb/management/goal.rb', line 7

def session
  @session
end

Class Method Details

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



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

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

.for_account(account) ⇒ Object



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

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

.for_profile(profile) ⇒ Object



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

def self.for_profile(profile)
  all(profile.session, profile.path + '/goals')
end

.for_web_property(web_property) ⇒ Object



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

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

Instance Method Details

#destinationObject



34
35
36
# File 'lib/garb/management/goal.rb', line 34

def destination
  @destination ||= Destination.new(@entry['urlDestinationDetails'])
end