Skip to content

Instantly share code, notes, and snippets.

@oddlyfunctional
Created July 24, 2015 07:08
Show Gist options
  • Save oddlyfunctional/9567020f5dbf40db9b8a to your computer and use it in GitHub Desktop.
Save oddlyfunctional/9567020f5dbf40db9b8a to your computer and use it in GitHub Desktop.
Extract and sort keys from hash
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