Sha256: b12a0b339a6f0d138b2f59487898a6f5520fb8c3a2544ab76c989f279fda1415
Contents?: true
Size: 687 Bytes
Versions: 26
Compression:
Stored size: 687 Bytes
Contents
module Bmg class Summarizer # # Collect the count of distinct values. # # Example: # # # direct ruby usage # Bmg::Summarizer.distinct_count(:qty).summarize(...) # class DistinctCount < Summarizer # Returns [] as least value. def least() {} end # Adds val to the memo array def _happens(memo, val) memo[val] = true memo end def finalize(memo) memo.keys.size end end # class DistinctCount # Factors a distinct count summarizer def self.distinct_count(*args, &bl) DistinctCount.new(*args, &bl) end end # class Summarizer end # module Bmg
Version data entries
26 entries across 26 versions & 1 rubygems