merge(p1)
public
Returns a new hash containing the contents of
other_hash and the contents of hsh, overwriting entries
in hsh with duplicate keys with
those from other_hash.
h1 = { "a" => 100, "b" => 200 }
h2 = { "b" => 254, "c" => 300 }
h1.merge(h2)
h1
Show source
static VALUE
rb_hash_merge(VALUE hash1, VALUE hash2)
{
return rb_hash_update(rb_obj_dup(hash1), hash2);
}