Class: Garb::AccountFeedRequest
- Inherits:
-
Object
- Object
- Garb::AccountFeedRequest
- Defined in:
- lib/garb/account_feed_request.rb
Constant Summary collapse
- URL =
"https://www.google.com/analytics/feeds/accounts/default"
Instance Method Summary collapse
- #entries ⇒ Object
-
#initialize(session = Session) ⇒ AccountFeedRequest
constructor
A new instance of AccountFeedRequest.
- #parsed_response ⇒ Object
- #response ⇒ Object
- #segments ⇒ Object
Constructor Details
#initialize(session = Session) ⇒ AccountFeedRequest
Returns a new instance of AccountFeedRequest.
5 6 7 |
# File 'lib/garb/account_feed_request.rb', line 5 def initialize(session = Session) @request = DataRequest.new(session, URL) end |
Instance Method Details
#entries ⇒ Object
17 18 19 |
# File 'lib/garb/account_feed_request.rb', line 17 def entries parsed_response ? Array(parsed_response['feed']['entry']).flatten.compact : [] end |
#parsed_response ⇒ Object
13 14 15 |
# File 'lib/garb/account_feed_request.rb', line 13 def parsed_response @parsed_response ||= Crack::XML.parse(response.body) end |
#response ⇒ Object
9 10 11 |
# File 'lib/garb/account_feed_request.rb', line 9 def response @response ||= @request.send_request end |
#segments ⇒ Object
21 22 23 |
# File 'lib/garb/account_feed_request.rb', line 21 def segments parsed_response ? Array(parsed_response['feed']['dxp:segment']).flatten.compact : [] end |