Sha256: c128ad81fe7a66fe3896480b0f4892cb1112227c593139213ba16bde57ea685f
Contents?: true
Size: 540 Bytes
Versions: 52
Compression:
Stored size: 540 Bytes
Contents
module Bmg class Summarizer # # Sum summarizer. # # Example: # # # direct ruby usage # Bmg::Summarizer.sum(:qty).summarize(...) # class Sum < Summarizer # Returns 0 as least value. def least() 0 end # Keep memo+val as new value def _happens(memo, val) memo + (val.nil? ? 0 : val) end end # class Sum # Factors a sum summarizer def self.sum(*args, &bl) Sum.new(*args, &bl) end end # class Summarizer end # module Bmg
Version data entries
52 entries across 52 versions & 1 rubygems