Module: Enumerable

Defined in:
lib/bad_ass_extensions/enumerable.rb

Instance Method Summary collapse

Instance Method Details

#group_countObject



2
3
4
# File 'lib/bad_ass_extensions/enumerable.rb', line 2

def group_count
  self.group_by{|u| yield(u)}.inject({}){|hash, group| hash[group[0]]= group[1].length;hash }
end