class Sleek::Queries::Sum

Internal: Sum query.

Finds the average value for a given property.

target_property - the String name of target property on event.

Examples

sleek.queries.sum(:purchases, target_property: "total")
# => 2_072_70

Public Instance Methods

perform(events) click to toggle source
# File lib/sleek/queries/sum.rb, line 16
def perform(events)
  events.sum target_property
end