Check out example codes for "ruby merge array of hashes into one hash". It will help you in understanding the concepts better.
Code Example 1
a.inject(:merge)
#=> {:a=>:b, :c=>:d}
Code Example 2
a.reduce Hash.new, :merge
Learn ReactJs, React Native from akashmittal.com