> Please share your quickies!
> 
> 

A complement to Array each_with_index that I find myself using quite often
when juggling with Arrays. Makes the code more legible.

class Array
  def collect_with_index
    r = Array.new(length)
    each_with_index do | o, i | r[i] = yield(o,i) end r
  end
end

greetings,

Brian

-- 
Brian Schr?der
http://www.brian-schroeder.de/