class Prosperity::Extractors::Total
Public Class Methods
key()
click to toggle source
# File lib/prosperity/extractors/total.rb, line 3 def self.key "total" end
Public Instance Methods
to_a()
click to toggle source
# File lib/prosperity/extractors/total.rb, line 7 def to_a data = [] period.each_period(start_time, end_time) do |start_time| if metric.sql? data << count_up_to_date_with_sql(start_time) elsif metric.ruby? data << metric.value_at.call(start_time, period) else s = scope.where("#{metric.group_by} < ?", start_time) data << metric.aggregate.apply(s) end end data end