Created
January 21, 2015 22:41
-
-
Save johnsinco/3e29497b5ff29ff56d23 to your computer and use it in GitHub Desktop.
Ruby Hash merge vs update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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