Sha256: 317e37d604cb6b66a6845d9336b5608e59b81df265b0db6039c3240caf5acb0b

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 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, [])
      filters opts.fetch(:filters, [])
      sort opts.fetch(:sort, [])
    end

    def results
      ReportResponse.new(send_request_for_body).results
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
garb-0.4.2 lib/garb/report.rb
garb-0.4.1 lib/garb/report.rb
garb-0.4.0 lib/garb/report.rb