Skip to content

Instantly share code, notes, and snippets.

@visibletrap
Created January 18, 2012 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save visibletrap/1633359 to your computer and use it in GitHub Desktop.
Save visibletrap/1633359 to your computer and use it in GitHub Desktop.
Tap
def do_tap(hash)
{}.tap do |result|
hash.each { |key, value| result[key] = do_something(value) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment