# File lib/backports/1.9.1/enumerable/each_with_index.rb, line 6 def each_with_index_with_optional_args_and_block(*args) return to_enum(:each_with_index, *args) unless block_given? idx = 0 each(*args) { |o| yield(o, idx); idx += 1 } self end