Module: ChartMogul::Metrics
- Defined in:
- lib/chartmogul/metrics/arr.rb,
lib/chartmogul/metrics/asp.rb,
lib/chartmogul/metrics/ltv.rb,
lib/chartmogul/metrics/mrr.rb,
lib/chartmogul/metrics/arpa.rb,
lib/chartmogul/metrics/base.rb,
lib/chartmogul/metrics/activity.rb,
lib/chartmogul/metrics/subscription.rb,
lib/chartmogul/metrics/customer_count.rb,
lib/chartmogul/metrics/mrr_churn_rate.rb,
lib/chartmogul/metrics/all_key_metrics.rb,
lib/chartmogul/metrics/customer_churn_rate.rb
Defined Under Namespace
Classes: ARPA, ARPAs, ARR, ARRs, ASP, ASPs, Activities, Activity, AllKeyMetric, AllKeyMetrics, CustomerChurnRate, CustomerChurnRates, CustomerCount, CustomerCounts, LTV, LTVs, MRR, MRRChurnRate, MRRChurnRates, MRRs, Subscription, Subscriptions
Class Method Summary
collapse
Class Method Details
.arpa(options = {}) ⇒ Object
8
9
10
|
# File 'lib/chartmogul/metrics/base.rb', line 8
def self.arpa(options = {})
ChartMogul::Metrics::ARPAs.all(preprocess_params(options))
end
|
.arr(options = {}) ⇒ Object
12
13
14
|
# File 'lib/chartmogul/metrics/base.rb', line 12
def self.arr(options = {})
ChartMogul::Metrics::ARRs.all(preprocess_params(options))
end
|
.asp(options = {}) ⇒ Object
16
17
18
|
# File 'lib/chartmogul/metrics/base.rb', line 16
def self.asp(options = {})
ChartMogul::Metrics::ASPs.all(preprocess_params(options))
end
|
.customer_churn_rate(options = {}) ⇒ Object
.customer_count(options = {}) ⇒ Object
.ltv(options = {}) ⇒ Object
32
33
34
|
# File 'lib/chartmogul/metrics/base.rb', line 32
def self.ltv(options = {})
ChartMogul::Metrics::LTVs.all(preprocess_params(options))
end
|
.mrr(options = {}) ⇒ Object
28
29
30
|
# File 'lib/chartmogul/metrics/base.rb', line 28
def self.mrr(options = {})
ChartMogul::Metrics::MRRs.all(preprocess_params(options))
end
|
.mrr_churn_rate(options = {}) ⇒ Object
36
37
38
|
# File 'lib/chartmogul/metrics/base.rb', line 36
def self.mrr_churn_rate(options = {})
ChartMogul::Metrics::MRRChurnRates.all(preprocess_params(options))
end
|
.preprocess_params(options) ⇒ Object
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/chartmogul/metrics/base.rb', line 42
def self.preprocess_params(options)
[:start_date, :end_date].each do |param_name|
options[param_name.to_s.gsub('_', '-')] = options.delete(param_name) if options[param_name]
end
[:geo, :plans].each do |param_name|
if options[param_name] && options[param_name].kind_of?(Array)
options[param_name] = options[param_name].join(',')
end
end
options
end
|