Class: Garb::Management::WebProperty

Inherits:
Object
  • Object
show all
Defined in:
lib/garb/management/web_property.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_idObject (readonly)

Returns the value of attribute account_id.



5
6
7
# File 'lib/garb/management/web_property.rb', line 5

def 
  @account_id
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/garb/management/web_property.rb', line 5

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/garb/management/web_property.rb', line 4

def path
  @path
end

#sessionObject (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.()
  all(.session, .path+'/webproperties')
end

Instance Method Details

#profilesObject



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

def profiles
  @profiles ||= Profile.for_web_property(self)
end