Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Enumerator
/
Lazy
/
//opt/alt/ruby27/share/ri/system/Enumerator/Lazy/enum_for-i.ri
U:RDoc::AnyMethod[iI" enum_for:ETI"Enumerator::Lazy#enum_for;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I"ESimilar to Object#to_enum, except it returns a lazy enumerator. ;TI"?This makes it easy to define Enumerable methods that will ;TI"<naturally remain lazy if called from a lazy enumerator.;To:RDoc::Markup::BlankLine o; ; [I"@For example, continuing from the example in Object#to_enum:;T@o:RDoc::Markup::Verbatim; [ I"7# See Object#to_enum for the definition of repeat ;TI"r = 1..Float::INFINITY ;TI"/r.repeat(2).first(5) # => [1, 1, 2, 2, 3] ;TI"'r.repeat(2).class # => Enumerator ;TI"=r.repeat(2).map{|n| n ** 2}.first(5) # => endless loop! ;TI"+# works naturally on lazy enumerator: ;TI"2r.lazy.repeat(2).class # => Enumerator::Lazy ;TI"Cr.lazy.repeat(2).map{|n| n ** 2}.first(5) # => [1, 1, 4, 4, 9];T:@format0: @fileI"enumerator.c;T:0@omit_headings_from_table_of_contents_below0I"�lzy.enum_for(method = :each, *args) -> lazy_enum lzy.enum_for(method = :each, *args) {|*args| block } -> lazy_enum;T0[ I"(*args);T@FI" Lazy;TcRDoc::NormalClass00