Sha256: d3e6acf79dc9d2efec0fa424234e4f35414fe0acf335709619fb68c15acb7164
Contents?: true
Size: 339 Bytes
Versions: 9
Compression:
Stored size: 339 Bytes
Contents
module Stages class Count < Stage def process result = Hash.new{ |h, k| h[k] = 0 } while !source_empty? v = source.run if v.is_a? Hash v.each_pair{ |key, value| result[key] += (value || 0) } else result[v] += 1 end end handle_value result end end end
Version data entries
9 entries across 9 versions & 1 rubygems