Sha256: 72867f8563b09f4e3ecf02738860ccb3c1573adfc3e68f022424a143e9e86f99

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

module Kanaui
  module DashboardHelper

    class DashboardApi < KillBillClient::Model::Resource

      KILLBILL_ANALYTICS_PREFIX = "/plugins/killbill-analytics"

      class << self

        def available_reports(options = {})
          path = "#{KILLBILL_ANALYTICS_PREFIX}/reports"
          response = KillBillClient::API.get path, {}, options
          response.body
        end

        def reports(start_date, end_date, name, smooth, format, options = {})
          path = "#{KILLBILL_ANALYTICS_PREFIX}/reports?format=json&startDate=#{start_date}&endDate=#{end_date}&name=#{name}"
          path = "#{path}&smooth=#{smooth}" if smooth
          response = KillBillClient::API.get path, {}, options
          response.body
        end

      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kanaui-0.5.0 app/helpers/kanaui/dashboard_helper.rb