From: "Sarcar, Shourya C (GE Healthcare)" Date: 2008-11-05T19:52:11+09:00 Subject: Re: replace values in hash > -----Original Message----- > From: jason.lillywhite@gmail.com [mailto:jason.lillywhite@gmail.com] > Sent: Wednesday, November 05, 2008 12:24 PM > To: ruby-talk ML > Subject: replace values in hash > > how would I iterate over a hash, such as > > x = { 'a' => "hi", 'b' => nil, 'c' => "do"} h.keys.each {|d| h[d] = "foo" if h[d] == nil}