Class Stream::FilteredStream
In: lib/stream.rb
Parent: WrappedStream

A FilteredStream selects all elements which satisfy a given booelan block of another stream being wrapped.

A FilteredStream is created by the method filtered:

 (1..6).create_stream.filtered { |x| x % 2 == 0 }.to_a ==> [2, 4, 6]

Methods

Public Class methods

Create a new FilteredStream wrapping otherStream and selecting all its elements which satisfy the condition defined by the block_filter_.

Public Instance methods

at_end? has to look ahead if there is an element satisfing the filter

Returns the current position of the stream.

[Validate]