Module: ObjectHelper::Array
- Defined in:
- lib/object_helper/array.rb
Instance Method Summary collapse
Instance Method Details
#to_hash_with_array ⇒ Object
4 5 6 7 8 |
# File 'lib/object_helper/array.rb', line 4 def to_hash_with_array each_with_object({}) do |(key, value), result| (result[key] ||= []).push(value) end end |