using merge with a block
myHash2 = { 1 => "Two", 2 => "New Value", 3 => "New Three" }
myHash = { 1 => "One", 2 => "Two", 3 => "Three", 4 => "Four",5 => "Five" }
myHash.merge( myHash2 ){|key,old,new| new = old + "_new" }
Related examples in the same category