Class | Stream::ConcatenatedStream |
In: |
lib/stream.rb
|
Parent: | WrappedStream |
Given a stream of streams. Than a ConcatenatedStream is obtained by concatenating these in the given order. A ConcatenatedStream is created by the methods Stream#concatenate or Stream#concatenate_collected send to a stream of streams or by the method + which concatenats two streams:
((1..3).create_stream + [4,5].create_stream).to_a ==> [1, 2, 3, 4, 5]
wrapped_stream | -> | streamOfStreams |
Creates a new ConcatenatedStream wrapping the stream of streams streamOfStreams.
If the current stream is at end, than at_end? has to look ahead to find a non empty in the stream of streams, which than gets the current stream.
Returns the previous element of @currentStream. at_beginning? ensured that there is one.