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
readonly
Returns the value of attribute account_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Class Method Summary collapse
- .all(session = Session, path = '/accounts/~all/webproperties') ⇒ Object
- .for_account(account) ⇒ Object
Instance Method Summary collapse
-
#initialize(entry, session) ⇒ WebProperty
constructor
A new instance of WebProperty.
- #profiles ⇒ Object
Constructor Details
#initialize(entry, session) ⇒ WebProperty
Returns a new instance of WebProperty.
16 17 18 19 20 21 22 23 |
# File 'lib/garb/management/web_property.rb', line 16 def initialize(entry, session) @session = session @path = Garb.parse_link(entry, "self").gsub(Feed::BASE_URL, '') properties = Garb.parse_properties(entry) @id = properties["web_property_id"] @account_id = properties["account_id"] end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
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 (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/garb/management/web_property.rb', line 5 def id @id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
4 5 6 |
# File 'lib/garb/management/web_property.rb', line 4 def path @path end |
#session ⇒ Object (readonly)
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(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 |
Instance Method Details
#profiles ⇒ Object
25 26 27 |
# File 'lib/garb/management/web_property.rb', line 25 def profiles @profiles ||= Profile.for_web_property(self) end |