Class: Garb::Management::Profile
- Inherits:
-
Object
- Object
- Garb::Management::Profile
- Includes:
- ProfileReports
- Defined in:
- lib/garb/management/profile.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.
-
#table_id ⇒ Object
Returns the value of attribute table_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#web_property_id ⇒ Object
Returns the value of attribute web_property_id.
Class Method Summary collapse
- .all(session = Session, path = '/accounts/~all/webproperties/~all/profiles') ⇒ Object
- .for_account(account) ⇒ Object
- .for_web_property(web_property) ⇒ Object
- .new_from_entry(entry, session) ⇒ Object
Instance Method Summary collapse
Methods included from ProfileReports
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/garb/management/profile.rb', line 8 def account_id @account_id end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/garb/management/profile.rb', line 8 def id @id end |
#path ⇒ Object
Returns the value of attribute path.
7 8 9 |
# File 'lib/garb/management/profile.rb', line 7 def path @path end |
#session ⇒ Object
Returns the value of attribute session.
7 8 9 |
# File 'lib/garb/management/profile.rb', line 7 def session @session end |
#table_id ⇒ Object
Returns the value of attribute table_id.
8 9 10 |
# File 'lib/garb/management/profile.rb', line 8 def table_id @table_id end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/garb/management/profile.rb', line 8 def title @title end |
#web_property_id ⇒ Object
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_from_entry(entry, session)} end |
.for_account(account) ⇒ Object
15 16 17 |
# File 'lib/garb/management/profile.rb', line 15 def self.for_account(account) all(account.session, account.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 |
.new_from_entry(entry, session) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/garb/management/profile.rb', line 23 def self.new_from_entry(entry, session) profile = new profile.session = session profile.path = Garb.parse_link(entry, "self").gsub(Feed::BASE_URL, '') profile.properties = Garb.parse_properties(entry) profile end |
Instance Method Details
#goals ⇒ Object
39 40 41 |
# File 'lib/garb/management/profile.rb', line 39 def goals Goal.for_profile(self) end |
#properties=(properties) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/garb/management/profile.rb', line 31 def properties=(properties) self.id = properties['profile_id'] self.table_id = properties['dxp:table_id'] self.title = properties['profile_name'] self.account_id = properties['account_id'] self.web_property_id = properties['web_property_id'] end |