Skip to content

Instantly share code, notes, and snippets.

@jcsrb
Created March 7, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcsrb/dec329b7ce5dba9519f4a52f4f006d98 to your computer and use it in GitHub Desktop.
Save jcsrb/dec329b7ce5dba9519f4a52f4f006d98 to your computer and use it in GitHub Desktop.
Dig in hashes or arrays
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