Skip to content
instance method

Enumerator#each_with_index

() { (Elem, ::Integer index) -> untyped } -> self
() -> ::Enumerator[[ Elem, ::Integer ], self]
e.each_with_index {|(*args), idx| ... }
e.each_with_index

Same as Enumerator#with_index(0), i.e. there is no starting offset.

If no block is given, a new Enumerator is returned that includes the index.

See also #each #each_with_object #+ #feed also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0