Sha256: 4453ab7b6961b063b35f5bd8d94bfc80e24e4013e775ea486295df4ecd958e9f

Contents?: true

Size: 611 Bytes

Versions: 7

Compression:

Stored size: 611 Bytes

Contents

module Garb
  module Management
    class Feed
      BASE_URL = "https://www.google.com/analytics/feeds/datasources/ga"

      attr_reader :request

      def initialize(session, path)
        @request = DataRequest.new(session, BASE_URL+path)
      end

      def parsed_response
        @parsed_response ||= Crack::XML.parse(response.body)
      end

      def entries
        # possible to have nil entries, yuck
        parsed_response ? [parsed_response['feed']['entry']].flatten.reject {|e| e.nil?} : []
      end

      def response
        @response ||= request.send_request
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
garb-0.8.5 lib/garb/management/feed.rb
titanous-garb-0.8.7 lib/garb/management/feed.rb
titanous-garb-0.8.5 lib/garb/management/feed.rb
garb-0.8.4 lib/garb/management/feed.rb
garb-0.8.3 lib/garb/management/feed.rb
garb-0.8.2 lib/garb/management/feed.rb
garb-0.8.1 lib/garb/management/feed.rb