Class: Polar::Resources::Metrics

Inherits:
Base
  • Object
show all
Defined in:
lib/polar/resources/metrics.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Polar::Resources::Base

Instance Method Details

#get(params = {}) ⇒ Hash

Get metrics

Parameters:

  • params (Hash) (defaults to: {})

    Query parameters

Options Hash (params):

  • :organization_id (String)

    Organization ID

  • :start_date (String)

    Start date (ISO format)

  • :end_date (String)

    End date (ISO format)

  • :interval (String)

    Interval (day, week, month)

Returns:

  • (Hash)

    Metrics data



15
16
17
18
# File 'lib/polar/resources/metrics.rb', line 15

def get(params = {})
  response = get('/metrics', params)
  response.body
end

#limits(params = {}) ⇒ Hash

Get metrics limits

Parameters:

  • params (Hash) (defaults to: {})

    Query parameters

Options Hash (params):

  • :organization_id (String)

    Organization ID

Returns:

  • (Hash)

    Metrics limits



24
25
26
27
# File 'lib/polar/resources/metrics.rb', line 24

def limits(params = {})
  response = get('/metrics/limits', params)
  response.body
end