Class: Garb::Management::WebProperty
- Inherits:
-
Object
- Object
- Garb::Management::WebProperty
- Defined in:
- lib/garb/management/web_property.rb
Instance Attribute Summary (collapse)
-
- (Object) account_id
Returns the value of attribute account_id.
-
- (Object) id
Returns the value of attribute id.
-
- (Object) path
Returns the value of attribute path.
-
- (Object) session
Returns the value of attribute session.
Class Method Summary (collapse)
- + (Object) all(session = Session, path = '/accounts/~all/webproperties'))
- + (Object) for_account(account)
- + (Object) new_from_entry(entry, session)
Instance Method Summary (collapse)
Instance Attribute Details
- (Object) account_id
Returns the value of attribute account_id
5 6 7 |
# File 'lib/garb/management/web_property.rb', line 5 def account_id @account_id end |
- (Object) id
Returns the value of attribute id
5 6 7 |
# File 'lib/garb/management/web_property.rb', line 5 def id @id end |
- (Object) path
Returns the value of attribute path
4 5 6 |
# File 'lib/garb/management/web_property.rb', line 4 def path @path end |
- (Object) session
Returns the value of attribute session
4 5 6 |
# File 'lib/garb/management/web_property.rb', line 4 def session @session end |
Class Method Details
+ (Object) all(session = Session, path = '/accounts/~all/webproperties'))
7 8 9 10 |
# File 'lib/garb/management/web_property.rb', line 7 def self.all(session = Session, path='/accounts/~all/webproperties') feed = Feed.new(session, path) feed.entries.map {|entry| new_from_entry(entry, session)} end |
+ (Object) for_account(account)
12 13 14 |
# File 'lib/garb/management/web_property.rb', line 12 def self.for_account(account) all(account.session, account.path+'/webproperties') end |
+ (Object) new_from_entry(entry, session)
16 17 18 19 20 21 22 |
# File 'lib/garb/management/web_property.rb', line 16 def self.new_from_entry(entry, session) web_property = new web_property.session = session web_property.path = Garb.parse_link(entry, "self").gsub(Feed::BASE_URL, '') web_property.properties = Garb.parse_properties(entry) web_property end |
Instance Method Details
- (Object) goals
33 34 35 |
# File 'lib/garb/management/web_property.rb', line 33 def goals @goals ||= Goal.for_web_property(self) end |
- (Object) profiles
29 30 31 |
# File 'lib/garb/management/web_property.rb', line 29 def profiles @profiles ||= Profile.for_web_property(self) end |
- (Object) properties=(properties)
24 25 26 27 |
# File 'lib/garb/management/web_property.rb', line 24 def properties=(properties) self.id = properties["web_property_id"] self.account_id = properties["account_id"] end |