Sha256: 74d554062ff451db1d8a3db8f02a1893dcf1a334915800b6d01046e6e4b7c412
Contents?: true
Size: 674 Bytes
Versions: 13
Compression:
Stored size: 674 Bytes
Contents
module Alf class Aggregator # # Defines a `sum()` aggregation operator. # # Example: # # # direct ruby usage # Alf::Aggregator.sum{ qty }.aggregate(...) # # # lispy # (summarize :supplies, [:sid], :total => sum{ qty }) # class Sum < Aggregator # Returns 0 as least value. # # @see Aggregator::InstanceMethods#least def least() 0 end # Aggregates on a tuple occurence through `memo + val` # # @see Aggregator::InstanceMethods#_happens def _happens(memo, val) memo + val end end # class Sum end # class Aggregator end # module Alf
Version data entries
13 entries across 13 versions & 2 rubygems