put two array elements into a 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