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]
Create a new FilteredStream wrapping otherStream and selecting all its elements which satisfy the condition defined by the block_filter_.