Class: Analytics::Profile
- Inherits:
-
Object
- Object
- Analytics::Profile
- Defined in:
- lib/analytics/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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#web_property_id ⇒ Object
readonly
Returns the value of attribute web_property_id.
Instance Method Summary collapse
-
#initialize(opts, access_token) ⇒ Profile
constructor
A new instance of Profile.
- #report ⇒ Object
Constructor Details
#initialize(opts, access_token) ⇒ Profile
Returns a new instance of Profile.
5 6 7 8 9 10 11 12 |
# File 'lib/analytics/profile.rb', line 5 def initialize(opts, access_token) @access_token = access_token @name = opts.fetch("name") @id = opts.fetch("id") @url = opts.fetch("websiteUrl") @web_property_id = opts.fetch("webPropertyId") @account_id = opts.fetch("accountId") end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object (private)
19 20 21 |
# File 'lib/analytics/profile.rb', line 19 def method_missing(method_name, *args, &block) report.send(method_name, args, block) end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
3 4 5 |
# File 'lib/analytics/profile.rb', line 3 def account_id @account_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/analytics/profile.rb', line 3 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/analytics/profile.rb', line 3 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/analytics/profile.rb', line 3 def url @url end |
#web_property_id ⇒ Object (readonly)
Returns the value of attribute web_property_id.
3 4 5 |
# File 'lib/analytics/profile.rb', line 3 def web_property_id @web_property_id end |
Instance Method Details
#report ⇒ Object
14 15 16 |
# File 'lib/analytics/profile.rb', line 14 def report @report ||= Analytics::Report.new(@id, @access_token) end |