module Enumerable

This code is release by the authors into the Public Domain

Public Instance Methods

collect_with_index() { |elem, i| ... } click to toggle source
# File lib/rprb.rb, line 4
def collect_with_index
    result = []
    each_with_index { |elem, i|
        result << yield(elem, i)
    }
    result
end