Module: Enumerable
- Defined in:
- lib/cool_extensions/enumerable.rb
Instance Method Summary collapse
Instance Method Details
#group_count ⇒ Object
2 3 4 |
# File 'lib/cool_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 |