Created
November 7, 2015 00:41
-
-
Save anonymous/2d73ce3dc30995a0094a to your computer and use it in GitHub Desktop.
I heard you like hashes...
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
# Found at the bottom of the App Controller | |
def hash2hash(hash, *keys) | |
hash = {} unless hash.is_a?(Hash) | |
keys.each {|key| | |
hash = hash[key] | |
hash = {} unless hash.is_a?(Hash) | |
} | |
hash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment