Merging many hashes into one in Ruby by makaroni4

E302c3320cd14b02cbe237b479d7f884?size=52

If your parse website with postal codes and from each page you get hash like this: { :street1 => [house1, house2], :street2 => [house3] ... } you need to merge this hashes into one. I saw a lot of bulky solutions, but here is the shortest:

array_of_hashes.inject(&:merge)

#ruby #hash