Class: GoogleApi::Ga::Profile
- Inherits:
-
Management
- Object
- Management
- GoogleApi::Ga::Profile
- Defined in:
- lib/google_api/ga/management/profile.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
-
#webproperty_id ⇒ Object
readonly
Returns the value of attribute webproperty_id.
Attributes inherited from Management
#created, #id, #name, #updated
Class Method Summary collapse
- .all(account_id = '~all', webproperty_id = '~all', profile_id = '~all') ⇒ Object
- .find(profile_id) ⇒ Object
Instance Method Summary collapse
- #goals ⇒ Object
-
#initialize(profile) ⇒ Profile
constructor
A new instance of Profile.
- #refresh ⇒ Object
- #webproperty ⇒ Object
Methods inherited from Management
Constructor Details
#initialize(profile) ⇒ Profile
Returns a new instance of Profile.
10 11 12 |
# File 'lib/google_api/ga/management/profile.rb', line 10 def initialize(profile) set(profile) end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/google_api/ga/management/profile.rb', line 5 def account_id @account_id end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/google_api/ga/management/profile.rb', line 7 def currency @currency end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
8 9 10 |
# File 'lib/google_api/ga/management/profile.rb', line 8 def timezone @timezone end |
#webproperty_id ⇒ Object (readonly)
Returns the value of attribute webproperty_id.
6 7 8 |
# File 'lib/google_api/ga/management/profile.rb', line 6 def webproperty_id @webproperty_id end |
Class Method Details
.all(account_id = '~all', webproperty_id = '~all', profile_id = '~all') ⇒ Object
14 15 16 |
# File 'lib/google_api/ga/management/profile.rb', line 14 def self.all(account_id = '~all', webproperty_id = '~all', profile_id = '~all') get({ accountId: account_id, webPropertyId: webproperty_id, profileId: '~all' }).map { |profile| Profile.new(profile) } end |
.find(profile_id) ⇒ Object
18 19 20 |
# File 'lib/google_api/ga/management/profile.rb', line 18 def self.find(profile_id) all('~all', '~all', profile_id).first end |
Instance Method Details
#goals ⇒ Object
35 36 37 |
# File 'lib/google_api/ga/management/profile.rb', line 35 def goals @goals ||= Goal.all(@account_id, @webproperty_id, @id) end |
#refresh ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/google_api/ga/management/profile.rb', line 22 def refresh @webproperty = nil @goals = nil set( Profile.get({ accountId: @account_id, webPropertyId: @webproperty_id, profileId: @id }).first ) return true end |
#webproperty ⇒ Object
31 32 33 |
# File 'lib/google_api/ga/management/profile.rb', line 31 def webproperty @webproperty ||= Webproperty.find(@webproperty_id) end |