Skip to content

Instantly share code, notes, and snippets.

@johnsinco
Created January 21, 2015 22:41
Show Gist options
  • Save johnsinco/3e29497b5ff29ff56d23 to your computer and use it in GitHub Desktop.
Save johnsinco/3e29497b5ff29ff56d23 to your computer and use it in GitHub Desktop.
Ruby Hash merge vs update
hsh = {a: 1, b: 2}
mrg = hsh.merge(b: 42)
mrg == hsh # false
upd = hsh.update(b: 69)
mrg == upd # true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment