Module: Enumerable

Instance Method Summary collapse

Instance Method Details

#group_by_countObject



2
3
4
# File 'lib/trax/core/ext/enumerable.rb', line 2

def group_by_count
  ::Hash.new(0).tap{|hash| each{|item| hash[item] += 1 } }
end