instance method Hash#update

View source on GitHub →

Hash#update(object) → Hash
  • object (Object | Hash) – The object to merge with this hash to produce the resulting hash.

Updates a hash in place with the key/value pairs of object, returns the hash.

Hash#update modifies the hash. To get a new hash instead, use Hash#merge.

var h = $H({one: "uno", two: "due"});
h.update({three: "tre"});
// -> h (a reference to the original hash)
// -> ["one", "two", "three"] (has merged contents)