From: Ben Bleything Date: 2009-01-29T04:21:06+09:00 Subject: Re: "adding" two hashes On Wed, Jan 28, 2009 at 11:07 AM, Bryson Smith wrote: > Do I need to write my own function to parse through each hash's keys? > Is there a built-in way to do this? You can try Hash#merge: irb(main):007:0> a = {:a => 1} => {:a=>1} irb(main):008:0> b = {:b => 2} => {:b=>2} irb(main):009:0> c = a.merge( b ) => {:a=>1, :b=>2} Note that if you have duplicate keys, the values in b will override the values in a. Ben