lzy.to_enum(method = :each, *args) â lazy_enumlzy.to_enum(method = :each, *args) {|*args| block} â lazy_enum
Instance Public methods
Similar to Kernel#to_enum, except it returns a lazy enumerator. This makes
it easy to define Enumerable methods that
will naturally remain lazy if called from a lazy enumerator.
For example, continuing from the example in Kernel#to_enum:
# See Kernel#to_enum for the definition of repeat
r = 1..Float::INFINITY
r.repeat(2).first(5) # =&g