Module: Enumerable

Defined in:
lib/enumerable.rb

Instance Method Summary collapse

Instance Method Details

#inject_with_index(injected) ⇒ Object



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

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