Skip to content

Instantly share code, notes, and snippets.

@pzaich
Created June 18, 2012 17:42
Show Gist options
  • Select an option

  • Save pzaich/2949634 to your computer and use it in GitHub Desktop.

Select an option

Save pzaich/2949634 to your computer and use it in GitHub Desktop.
new_collect
class Array
def new_collect
self.each_with_index do |n, i|
self[i] = yield(n)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment