Module: Enumerable
- Defined in:
- lib/enumerable_ext.rb
Instance Method Summary collapse
Instance Method Details
#hmap ⇒ Object
2 3 4 5 6 7 |
# File 'lib/enumerable_ext.rb', line 2 def hmap self.reduce({}) do |map, item| key, value = yield item map.tap {|map| map[key] = value } end end |