Class: BaremetricsAPI::Endpoint::Metrics

Inherits:
Object
  • Object
show all
Defined in:
lib/baremetrics_api/endpoint/metrics.rb

Constant Summary collapse

PATH =
'metrics'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Metrics

Returns a new instance of Metrics.



6
7
8
# File 'lib/baremetrics_api/endpoint/metrics.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#show_customers(metric:, start_date:, end_date:) ⇒ Object



18
19
20
# File 'lib/baremetrics_api/endpoint/metrics.rb', line 18

def show_customers(metric:, start_date:, end_date:)
  JSON.parse(show_customers_request(metric, start_date, end_date).body).with_indifferent_access
end

#show_metric(metric:, start_date:, end_date:, compare_to: 30, page: nil) ⇒ Object



14
15
16
# File 'lib/baremetrics_api/endpoint/metrics.rb', line 14

def show_metric(metric:, start_date:, end_date:, compare_to: 30, page: nil)
  JSON.parse(show_metric_request(metric, start_date, end_date, compare_to, page).body).with_indifferent_access
end

#show_plan_breakout(metric:, start_date:, end_date:) ⇒ Object



22
23
24
# File 'lib/baremetrics_api/endpoint/metrics.rb', line 22

def show_plan_breakout(metric:, start_date:, end_date:)
  JSON.parse(show_plan_breakout_request(metric, start_date, end_date).body).with_indifferent_access
end

#show_summary(start_date:, end_date:, page: nil) ⇒ Object



10
11
12
# File 'lib/baremetrics_api/endpoint/metrics.rb', line 10

def show_summary(start_date:, end_date:, page: nil)
  JSON.parse(show_summary_request(start_date, end_date, page).body).with_indifferent_access
end