Method: LazyList::ObjectMethods#build

Defined in:
lib/lazylist.rb

#build(&block) ⇒ Object

This method returns a Lazylist::ListBuilder instance for tuplewise building of lists like the zip method does. This method call

build { x + y }.where(:x => 1..3, :y => 1..3)

returns the same list [ 2, 4, 6 ] as this expression does

LazyList[1..3].zip(LazyList[1..3]) { |x, y| x + y }


649
650
651
# File 'lib/lazylist.rb', line 649

def build(&block)
  LazyList::ListBuilder.create_build(&block)
end