Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f27f2f498c
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.703 kb
module Garb
module Management
class Feed
require 'xmlsimple'
BASE_URL = "https://www.google.com/analytics/feeds/datasources/ga"
attr_reader :request
def initialize(session, path)
@request = Request::Data.new(session, BASE_URL+path)
end
def parsed_response
# @parsed_response ||= JSON.parse(response.body)
@parsed_response ||= {'feed' => XmlSimple.xml_in(response.body)}
end
def entries
# possible to have nil entries, yuck
parsed_response ? [parsed_response['feed']['entry']].flatten.compact : []
end
def response
@response ||= request.send_request
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.