Skip to content

Instantly share code, notes, and snippets.

@AndyMoreland
Created July 6, 2010 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AndyMoreland/465852 to your computer and use it in GitHub Desktop.
Save AndyMoreland/465852 to your computer and use it in GitHub Desktop.
def map(&block)
new_hash = Hash.new
self.each do |k,v|
new_hash[k] = yield(v)
end
new_hash
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment