class Stream::WrappedStream

Class WrappedStream is the abstract superclass for stream classes that wrap another stream. The basic methods are simple delegated to the wrapped stream. Thus creating a WrappedStream on a CollectionStream would yield an equivalent stream:

arrayStream = [1,2,3].create_stream

arrayStream.to_a => [1,2,3]
Stream::WrappedStream.new(arrayStream).to_a => [1,2,3]

Attributes

wrapped_stream[R]

Public Class Methods

new(other_stream) click to toggle source

Create a new WrappedStream wrapping the Stream other_stream.

    # File lib/stream.rb
304 def initialize(other_stream)
305   @wrapped_stream = other_stream
306 end

Public Instance Methods

at_beginning?() click to toggle source
    # File lib/stream.rb
308 def at_beginning?
309   @wrapped_stream.at_beginning?
310 end
at_end?() click to toggle source
    # File lib/stream.rb
312 def at_end?
313   @wrapped_stream.at_end?
314 end
basic_backward() click to toggle source
    # File lib/stream.rb
333 def basic_backward
334   @wrapped_stream.basic_backward
335 end
basic_forward() click to toggle source
    # File lib/stream.rb
329 def basic_forward
330   @wrapped_stream.basic_forward
331 end
set_to_begin() click to toggle source
    # File lib/stream.rb
320 def set_to_begin
321   @wrapped_stream.set_to_begin
322 end
set_to_end() click to toggle source
    # File lib/stream.rb
316 def set_to_end
317   @wrapped_stream.set_to_end
318 end
unwrapped() click to toggle source

Returns the wrapped stream unwrapped.

    # File lib/stream.rb
325 def unwrapped
326   @wrapped_stream.unwrapped
327 end