Sha256: 3351b7fc4520714ad7e3f0d1563ada3804436ff2859d5bc78985f2e1f57e2cc0

Contents?: true

Size: 599 Bytes

Versions: 16

Compression:

Stored size: 599 Bytes

Contents

module Garb
  class Report
    include Resource

    MONTH = 2592000
    URL = "https://www.google.com/analytics/feeds/data"

    def initialize(profile, opts={})
      @profile = profile

      @start_date = opts.fetch(:start_date, Time.now - MONTH)
      @end_date = opts.fetch(:end_date, Time.now)
      @limit = opts.fetch(:limit, nil)
      @offset = opts.fetch(:offset, nil)

      metrics opts.fetch(:metrics, [])
      dimensions opts.fetch(:dimensions, [])
      sort opts.fetch(:sort, [])
    end

    def results
      ReportResponse.new(send_request_for_body).results
    end

  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
garb-0.8.1 lib/garb/report.rb
garb-0.8.0 lib/garb/report.rb
garb-0.7.6 lib/garb/report.rb
garb-0.7.5 lib/garb/report.rb
shingara-garb-0.7.6 lib/garb/report.rb
garb-no-activesupport-0.7.4 lib/garb/report.rb
garb-0.7.4 lib/garb/report.rb
garb-no-activesupport-0.7.3 lib/garb/report.rb
garb-0.7.3 lib/garb/report.rb
garb-0.7.2 lib/garb/report.rb
garb-0.7.1 lib/garb/report.rb
garb-authsub-0.7.0 lib/garb/report.rb
garb-0.7.0 lib/garb/report.rb
garb-0.6.0 lib/garb/report.rb
garb-0.5.1 lib/garb/report.rb
garb-0.5.0 lib/garb/report.rb