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
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.
-
#table_id ⇒ Object
readonly
Returns the value of attribute table_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#web_property_id ⇒ Object
readonly
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
Instance Method Summary collapse
-
#initialize(entry, session) ⇒ Profile
constructor
A new instance of Profile.
Methods included from ProfileReports
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_id ⇒ Object (readonly)
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 (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/garb/management/profile.rb', line 8 def id @id end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/garb/management/profile.rb', line 7 def path @path end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
7 8 9 |
# File 'lib/garb/management/profile.rb', line 7 def session @session end |
#table_id ⇒ Object (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 |
#title ⇒ Object (readonly)
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 (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.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 |