Class: GoogleApi::Ga::Goal
- Inherits:
-
Management
- Object
- Management
- GoogleApi::Ga::Goal
- Defined in:
- lib/google_api/ga/management/goal.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#goal ⇒ Object
readonly
Returns the value of attribute goal.
-
#profile_id ⇒ Object
readonly
Returns the value of attribute profile_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#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', goal_id = '~all') ⇒ Object
- .find(goal_id) ⇒ Object
Instance Method Summary collapse
-
#initialize(goal) ⇒ Goal
constructor
A new instance of Goal.
- #profile ⇒ Object
- #refresh ⇒ Object
Methods inherited from Management
Constructor Details
#initialize(goal) ⇒ Goal
Returns a new instance of Goal.
13 14 15 |
# File 'lib/google_api/ga/management/goal.rb', line 13 def initialize(goal) set(goal) end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/google_api/ga/management/goal.rb', line 5 def account_id @account_id end |
#active ⇒ Object (readonly)
Returns the value of attribute active.
9 10 11 |
# File 'lib/google_api/ga/management/goal.rb', line 9 def active @active end |
#goal ⇒ Object (readonly)
Returns the value of attribute goal.
11 12 13 |
# File 'lib/google_api/ga/management/goal.rb', line 11 def goal @goal end |
#profile_id ⇒ Object (readonly)
Returns the value of attribute profile_id.
7 8 9 |
# File 'lib/google_api/ga/management/goal.rb', line 7 def profile_id @profile_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/google_api/ga/management/goal.rb', line 10 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/google_api/ga/management/goal.rb', line 8 def value @value end |
#webproperty_id ⇒ Object (readonly)
Returns the value of attribute webproperty_id.
6 7 8 |
# File 'lib/google_api/ga/management/goal.rb', line 6 def webproperty_id @webproperty_id end |
Class Method Details
.all(account_id = '~all', webproperty_id = '~all', profile_id = '~all', goal_id = '~all') ⇒ Object
17 18 19 |
# File 'lib/google_api/ga/management/goal.rb', line 17 def self.all(account_id = '~all', webproperty_id = '~all', profile_id = '~all', goal_id = '~all') get({ accountId: account_id, webPropertyId: webproperty_id, profileId: profile_id, goalId: goal_id }).map { |goal| Goal.new(goal) } end |
.find(goal_id) ⇒ Object
21 22 23 |
# File 'lib/google_api/ga/management/goal.rb', line 21 def self.find(goal_id) all('~all', '~all', '~all', goal_id).first end |
Instance Method Details
#profile ⇒ Object
33 34 35 |
# File 'lib/google_api/ga/management/goal.rb', line 33 def profile @profile ||= Profile.find(@profile_id) end |
#refresh ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/google_api/ga/management/goal.rb', line 25 def refresh @profile = nil set( Goal.get({ accountId: @account_id, webPropertyId: @webproperty_id, profileId: @profile_id, goalId: @id }).first ) return true end |