Created
March 7, 2018 15:24
-
-
Save jcsrb/dec329b7ce5dba9519f4a52f4f006d98 to your computer and use it in GitHub Desktop.
Dig in hashes or arrays
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 extract_stuff(stuff, path) | |
path.empty? stuff : extract_stuff(stuff[path.shift], path) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment