Module: Chartmogul::Metric

Defined in:
lib/chartmogul/metric.rb,
lib/chartmogul/metrics/base.rb,
lib/chartmogul/metrics/customer.rb,
lib/chartmogul/metrics/activity.rb,
lib/chartmogul/metrics/subscription.rb

Defined Under Namespace

Classes: Activity, Base, Customer, Subscription

Class Method Summary collapse

Class Method Details

.define_metric_singleton_method(method_prefix) ⇒ Object


12
13
14
15
16
17
18
19
# File 'lib/chartmogul/metric.rb', line 12

def self.define_metric_singleton_method(method_prefix)
  method_name = [method_prefix, "metrics"].join("_")
  define_singleton_method(method_name) do |start_date:, end_date:, **attrs|
    Metric::Base.retrieve(
      method_prefix, start_date: start_date, end_date: end_date, **attrs
    )
  end
end

.metric_typesObject


8
9
10
# File 'lib/chartmogul/metric.rb', line 8

def self.metric_types
  [:all, :mrr, :arr, :arpa, :asp, :cc, :ccr, :mrrcr, :ltv]
end