Created
March 28, 2019 17:14
-
-
Save joegaudet/4b6069bd7b0ab2544278989bffc80d44 to your computer and use it in GitHub Desktop.
Hash Conflict Resolution
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
hash_a = {foo: 'bar', baz: 'qux'} | |
hash_b = {foo: 'baz'} | |
hash_c = hash_a.merge(hash_b) do |key, old, new| | |
[old, new] | |
end | |
hash_c == { | |
foo: ['bar', 'baz'], | |
baz: 'qux' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment