Sha256: 6e1962fe9c2509c8f714651f06a212c9bad51be633bc0ef84fd6a37b45b2406e

Contents?: true

Size: 785 Bytes

Versions: 24

Compression:

Stored size: 785 Bytes

Contents

require 'seatsio/exception'
require 'seatsio/httpClient'
require 'seatsio/domain'
require 'json'
require 'cgi'

module Seatsio
  class UsageReportsClient
    def initialize(http_client)
      @http_client = http_client
    end

    def summary_for_all_months
      url = "reports/usage"
      body = @http_client.get(url)
      UsageSummaryForAllMoths.new(body)
    end

    def details_for_month(month)
      url = "reports/usage/month/" + month.serialize
      body = @http_client.get(url)
      body.map { |item| UsageDetails.new(item) }
    end

    def details_for_event_in_month(eventId, month)
      url = "reports/usage/month/" + month.serialize + "/event/" + eventId.to_s
      body = @http_client.get(url)
      body.map { |item| UsageForObject.new(item) }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
seatsio-42.3.0 lib/seatsio/usage_reports.rb
seatsio-42.2.0 lib/seatsio/usage_reports.rb
seatsio-42.1.0 lib/seatsio/usage_reports.rb
seatsio-42.0.0 lib/seatsio/usage_reports.rb
seatsio-41.1.0 lib/seatsio/usage_reports.rb
seatsio-40.1.0 lib/seatsio/usage_reports.rb
seatsio-40.0.0 lib/seatsio/usage_reports.rb
seatsio-39.0.0 lib/seatsio/usage_reports.rb
seatsio-38.0.0 lib/seatsio/usage_reports.rb
seatsio-37.1.0 lib/seatsio/usage_reports.rb
seatsio-37.0.0 lib/seatsio/usage_reports.rb
seatsio-36.3.0 lib/seatsio/usage_reports.rb
seatsio-36.2.0 lib/seatsio/usage_reports.rb
seatsio-36.1.0 lib/seatsio/usage_reports.rb
seatsio-36.0.0 lib/seatsio/usage_reports.rb
seatsio-35.3.0 lib/seatsio/usage_reports.rb
seatsio-35.2.0 lib/seatsio/usage_reports.rb
seatsio-35.1.1 lib/seatsio/usage_reports.rb
seatsio-35.1.0 lib/seatsio/usage_reports.rb
seatsio-35.0.0 lib/seatsio/usage_reports.rb