Module: Enumerable
- Defined in:
- lib/core_ext/core_ext.rb
Overview
Enumerable Extensions ==========================================================================
Instance Method Summary collapse
Instance Method Details
#to_histogram ⇒ Object
166 167 168 |
# File 'lib/core_ext/core_ext.rb', line 166 def to_histogram inject(Hash.new(0)) { |h,x| h[x] += 1; h } end |