Sha256: 6bbfbe554a90bb74130cdd2956a4d439ec443ca834d8d105ccba6ab378f8028f

Contents?: true

Size: 708 Bytes

Versions: 9

Compression:

Stored size: 708 Bytes

Contents

module Garb
  class Report
    include Resource

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

    def initialize(profile, opts={})
      ActiveSupport::Deprecation.warn("The use of Report will be removed in favor of 'extend Garb::Model'")

      @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

9 entries across 9 versions & 4 rubygems

Version Path
readmedia-garb-0.9.1.1 lib/garb/report.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/garb-0.9.1/lib/garb/report.rb
garb-0.9.1 lib/garb/report.rb
garb-0.9.0 lib/garb/report.rb
garb-0.8.5 lib/garb/report.rb
titanous-garb-0.8.7 lib/garb/report.rb
titanous-garb-0.8.5 lib/garb/report.rb
garb-0.8.4 lib/garb/report.rb
garb-0.8.3 lib/garb/report.rb