Created
July 24, 2015 07:08
-
-
Save oddlyfunctional/9567020f5dbf40db9b8a to your computer and use it in GitHub Desktop.
Extract and sort keys from hash
This file contains hidden or 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_and_sort_keys(hash) | |
hash.keys.map(&:to_s).sort_by(&:length) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment