lazy

lazy() Instance Public methods

grep

grep(p1) Instance Public methods

flat_map

lazy.flat_map { |obj| block } â a_lazy_enumerator Instance Public methods Returns a new lazy enumerator with the concatenated results of running block once for every element in lazy. ["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force #=> ["f", "o", "o", "b", "a", "r"] A value x returned by block is decomposed if either of the following conditions is true: a) <i>x</i> responds to both each and force, which means that <i>x</i> is a lazy enu

find_all

find_all() Instance Public methods

enum_for

lzy.enum_for(method = :each, *args) â lazy_enumlzy.enum_for(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

drop_while

drop_while() Instance Public methods

drop

drop(p1) Instance Public methods

collect_concat

lazy.flat_map { |obj| block } â a_lazy_enumerator Instance Public methods Returns a new lazy enumerator with the concatenated results of running block once for every element in lazy. ["foo", "bar"].lazy.flat_map {|i| i.each_char.lazy}.force #=> ["f", "o", "o", "b", "a", "r"] A value x returned by block is decomposed if either of the following conditions is true: a) <i>x</i> responds to both each and force, which means that <i>x</i> is a lazy en

collect

collect() Instance Public methods

chunk

chunk(*args) Instance Public methods