public
Description: Ruby and Rails core extensions used by GitHub.
Clone URL: git://github.com/github/hubahuba.git
defunkt (author)
Sat May 10 21:51:47 -0700 2008
commit  52a27da4d5aea71401bda44094fb6b4113b90b2c
tree    38cd27eb17194773d06fa9e01a5611aeff01731a
hubahuba / lib / enumerable.rb
100644 10 lines (9 sloc) 0.155 kb
1
2
3
4
5
6
7
8
9
10
module Enumerable
  def map_with_index
    result = []
    self.each_with_index do |elt, idx|
      result << yield(elt, idx)
    end
    result
  end
end