convert array of hashes to hash ruby code example
Example 1: ruby merge array of hashes into one hash
a.inject(:merge)
#=> {:a=>:b, :c=>:d}
Example 2: ruby merge array of hashes into one hash
a.reduce Hash.new, :merge
a.inject(:merge)
#=> {:a=>:b, :c=>:d}
a.reduce Hash.new, :merge