Skip to content

Instantly share code, notes, and snippets.

@marlabrizel
Last active December 22, 2015 03:33
Show Gist options
  • Save marlabrizel/5b84a29a94d192a19793 to your computer and use it in GitHub Desktop.
Save marlabrizel/5b84a29a94d192a19793 to your computer and use it in GitHub Desktop.
Ruby version of clojure's get in method
def get_in(data, array)
if array.size > 1
key = array.shift
get_in(data[key], array)
else
return data.values.first
end
end
@marlabrizel
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment