Module: Enumerable

Defined in:
lib/enumerable_extensions.rb

Instance Method Summary collapse

Instance Method Details

#inject_with_index(injected) ⇒ Object



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

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