End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Enumerator::Lazy#_enumerable_collect
_enumerable_collect
enumerator.c
View on GitHub ↗
Alias of #collect
Like Enumerable#map, but chains operation to be lazy-evaluated.
Example
(1..Float::INFINITY).lazy.map {|i| i**2 } #=> #<Enumerator::Lazy: #<Enumerator::Lazy: 1..Infinity>:map> (1..Float::INFINITY).lazy.map {|i| i**2 }.first(3) #=> [1, 4, 9]
See also
#collect
#eager
#_enumerable_collect_concat
#drop_while
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1