Skip to content

Instantly share code, notes, and snippets.

@mjbellantoni
Created May 15, 2011 23:32
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 mjbellantoni/973680 to your computer and use it in GitHub Desktop.
Save mjbellantoni/973680 to your computer and use it in GitHub Desktop.
Hash#map
class Hash
def map(&block)
mapped_hash = {}
self.each do |key, value|
mapped_hash[key] = yield value
end
mapped_hash
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment