Skip to content

Instantly share code, notes, and snippets.

@reinh
Created May 20, 2010 05:27
Show Gist options
  • Save reinh/407230 to your computer and use it in GitHub Desktop.
Save reinh/407230 to your computer and use it in GitHub Desktop.
module Enumerable2
def map2
new_array = []
each{|item| new_array << yield(item)}
return new_array
end
end
class Array
include Enumerable2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment