Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
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
enumerator.c
View on GitHub ↗
static VALUE
enumerator_each_with_index(VALUE obj)
{
return enumerator_with_index(0, NULL, obj);
}
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.