Hi everyone.

I would like to merge two (or more) hashes in to one single hash.
Imagine I have the following two hashes:

foo = {"luxuy" => ["Mercedes", "BMW"], "sport" => ["porsche","ferrari"]}
bar = {"luxuy" => ["BMW", "Bentley", "Rolls Royce"],
"sport"=>["lamborghini"]}

Then this is the result I'm looking for when merging the two:
result = {"luxuy" => ["Mercedes", "BMW", "Bentley", "Rolls
Royce"],"sport" => ["porsche", "ferrari", "lamborghini"]}

Any thoughts of how to easily achieve this? I've messed around with
.merge but without any success.

Thanks!

-- 
Posted via http://www.ruby-forum.com/.