module ESP::StatTotals

@private

Public Instance Methods

destroy() click to toggle source

Not Implemented. You cannot delete a Stat.

# File lib/esp/resources/concerns/stat_totals.rb, line 10
def destroy
  fail ESP::NotImplementedError
end
save() click to toggle source

Not Implemented. You cannot create or update a Stat.

# File lib/esp/resources/concerns/stat_totals.rb, line 5
def save
  fail ESP::NotImplementedError
end
total() click to toggle source

We only add new_1w* and old* fields as the new_1w field includes the counts from new_1h and new_1d.

# File lib/esp/resources/concerns/stat_totals.rb, line 15
def total
  attributes.select { |a, _v| a.match(/new_1w|old/) }.values.reduce(:+)
end
total_suppressed() click to toggle source
# File lib/esp/resources/concerns/stat_totals.rb, line 19
def total_suppressed
  attributes.select { |a, _v| a.match(/suppressed_/) }.values.reduce(:+)
end