Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Enumerator::Lazy#each_with_index
() { (E, ::Integer index) -> untyped } -> self
() -> ::Enumerator[[ E, ::Integer ], self]
lazy.each_with_index {|(*args), idx| block }
lazy.each_with_index
enumerator.c
View on GitHub ↗
static VALUE
lazy_each_with_index(VALUE obj)
{
return lazy_with_index_from(obj, LONG2NUM(0));
}
Equals to with_index(0).