Skip to content

Instantly share code, notes, and snippets.

@jdewind
Created November 22, 2013 19:31
Show Gist options
  • Save jdewind/7605495 to your computer and use it in GitHub Desktop.
Save jdewind/7605495 to your computer and use it in GitHub Desktop.
Terse approach to mapping a Hash
Hash[query.map { |k,v| [k, [v].flatten[0]] }]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment