Class: Garb::Management::Profile

Inherits:
Object
  • Object
show all
Includes:
ProfileReports
Defined in:
lib/garb/management/profile.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ProfileReports

add_report_method

Constructor Details

#initialize(entry, session) ⇒ Profile

Returns a new instance of Profile.



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/garb/management/profile.rb', line 23

def initialize(entry, session)
  @session = session
  @path = Garb.parse_link(entry, "self").gsub(Feed::BASE_URL, '')

  properties = Garb.parse_properties(entry)
  @id = properties['profile_id']
  @table_id = properties['table_id']
  @title = properties['profile_name']
  @account_id = properties['account_id']
  @web_property_id = properties['web_property_id']
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



8
9
10
# File 'lib/garb/management/profile.rb', line 8

def 
  @account_id
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/garb/management/profile.rb', line 8

def id
  @id
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/garb/management/profile.rb', line 7

def path
  @path
end

#sessionObject (readonly)

Returns the value of attribute session.



7
8
9
# File 'lib/garb/management/profile.rb', line 7

def session
  @session
end

#table_idObject (readonly)

Returns the value of attribute table_id.



8
9
10
# File 'lib/garb/management/profile.rb', line 8

def table_id
  @table_id
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/garb/management/profile.rb', line 8

def title
  @title
end

#web_property_idObject (readonly)

Returns the value of attribute web_property_id.



8
9
10
# File 'lib/garb/management/profile.rb', line 8

def web_property_id
  @web_property_id
end

Class Method Details

.all(session = Session, path = '/accounts/~all/webproperties/~all/profiles') ⇒ Object



10
11
12
13
# File 'lib/garb/management/profile.rb', line 10

def self.all(session = Session, path = '/accounts/~all/webproperties/~all/profiles')
  feed = Feed.new(session, path)
  feed.entries.map {|entry| new(entry, session)}
end

.for_account(account) ⇒ Object



15
16
17
# File 'lib/garb/management/profile.rb', line 15

def self.()
  all(.session, .path+'/webproperties/~all/profiles')
end

.for_web_property(web_property) ⇒ Object



19
20
21
# File 'lib/garb/management/profile.rb', line 19

def self.for_web_property(web_property)
  all(web_property.session, web_property.path+'/profiles')
end