1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix documentation for Enumerator::Lazy#with_index

If a block is given, it returns a lazy enumerator that will iterate
over the block, it doesn't iterate over the block immediately.

Fixes [Bug #17789]
This commit is contained in:
Jeremy Evans 2021-04-09 10:44:07 -07:00
parent 582f4bc188
commit 9c31fb6114

View file

@ -2709,7 +2709,8 @@ static const lazyenum_funcs lazy_with_index_funcs = {
* lazy.with_index(offset = 0) {|(*args), idx| block }
* lazy.with_index(offset = 0)
*
* If a block is given, iterates the given block for each element
* If a block is given, returns a lazy enumerator that will
* iterate over the given block for each element
* with an index, which starts from +offset+, and returns a
* lazy enumerator that yields the same values (without the index).
*