Module: Enumerable

Defined in:
lib/core_ext/enumerable.rb

Instance Method Summary collapse

Instance Method Details

#inject_with_index(injected) ⇒ Object



2
3
4
5
# File 'lib/core_ext/enumerable.rb', line 2

def inject_with_index(injected)
  each_with_index{ |obj, index| injected = yield(injected, obj, index) }
  injected
end