Created
March 23, 2017 16:24
-
-
Save af23me/0ace678198fe33dca22e80bb3e246ef5 to your computer and use it in GitHub Desktop.
Merge hash recursively
This file contains 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
def merge_hash_recursively(first_hash, second_hash) | |
first_hash.merge(second_hash) { |key, a_item, b_item| merge_hash_recursively(a_item, b_item) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment