Class: Analytics::Client
- Inherits:
-
Object
- Object
- Analytics::Client
- Defined in:
- lib/analytics/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #accounts ⇒ Object
- #flush! ⇒ Object
-
#initialize(access_token) ⇒ Client
constructor
A new instance of Client.
- #profiles ⇒ Object
- #web_properties ⇒ Object
Constructor Details
#initialize(access_token) ⇒ Client
Returns a new instance of Client.
5 6 7 8 |
# File 'lib/analytics/client.rb', line 5 def initialize(access_token) @access_token = access_token raise Analytics::Error::NoAccessTokenProvided if @access_token.nil? end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/analytics/client.rb', line 3 def access_token @access_token end |
Instance Method Details
#accounts ⇒ Object
10 11 12 |
# File 'lib/analytics/client.rb', line 10 def accounts @accounts ||= request_accounts end |
#flush! ⇒ Object
22 23 24 |
# File 'lib/analytics/client.rb', line 22 def flush! @accounts = nil end |
#profiles ⇒ Object
18 19 20 |
# File 'lib/analytics/client.rb', line 18 def profiles web_properties.map(&:profiles).flatten end |
#web_properties ⇒ Object
14 15 16 |
# File 'lib/analytics/client.rb', line 14 def web_properties accounts.map(&:web_properties).flatten end |