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

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



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

def 
  @account_id
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#pathObject

Returns the value of attribute path.



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

def path
  @path
end

#sessionObject

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.()
  all(.session, .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

#goalsObject



33
34
35
# File 'lib/garb/management/web_property.rb', line 33

def goals
  @goals ||= Goal.for_web_property(self)
end

#profilesObject



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. = properties["account_id"]
end