ruby merge array of hashes into one hash
a.inject(:merge) #=> {:a=>:b, :c=>:d}
Source: stackoverflow.com
ruby merge array of hashes into one hash
a.reduce Hash.new, :merge
Source: stackoverflow.com