Class: Garb::Management::WebProperty
- Inherits:
-
Object
- Object
- Garb::Management::WebProperty
- Defined in:
- lib/garb/management/web_property.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#path ⇒ Object
Returns the value of attribute path.
-
#session ⇒ Object
Returns the value of attribute session.
Class Method Summary collapse
- .all(session = Session, path = '/accounts/~all/webproperties') ⇒ Object
- .for_account(account) ⇒ Object
- .new_from_entry(entry, session) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#account_id ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/garb/management/web_property.rb', line 5 def id @id end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/garb/management/web_property.rb', line 4 def path @path end |
#session ⇒ Object
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
.all(session = Session, path = '/accounts/~all/webproperties') ⇒ Object
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 |
.for_account(account) ⇒ Object
12 13 14 |
# File 'lib/garb/management/web_property.rb', line 12 def self.for_account(account) all(account.session, account.path+'/webproperties') end |
.new_from_entry(entry, session) ⇒ Object
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
#goals ⇒ Object
33 34 35 |
# File 'lib/garb/management/web_property.rb', line 33 def goals @goals ||= Goal.for_web_property(self) end |
#profiles ⇒ Object
29 30 31 |
# File 'lib/garb/management/web_property.rb', line 29 def profiles @profiles ||= Profile.for_web_property(self) end |
#properties=(properties) ⇒ Object
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 |