Class: Garb::Management::Goal
- Inherits:
-
Object
- Object
- Garb::Management::Goal
- Extended by:
- Attributes
- Includes:
- PathAttribute
- Defined in:
- lib/garb/management/goal.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Class Method Summary collapse
- .all(session = Session, path = '/accounts/~all/webproperties/~all/profiles/~all/goals') ⇒ Object
- .for_account(account) ⇒ Object
- .for_profile(profile) ⇒ Object
- .for_web_property(web_property) ⇒ Object
Instance Method Summary collapse
- #destination ⇒ Object
-
#initialize(entry, session) ⇒ Goal
constructor
A new instance of Goal.
Methods included from Attributes
Methods included from PathAttribute
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
#session ⇒ Object (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.for_account(account) all(account.session, account.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
#destination ⇒ Object
34 35 36 |
# File 'lib/garb/management/goal.rb', line 34 def destination @destination ||= Destination.new(@entry['urlDestinationDetails']) end |