Class: Stream::WrappedStream
Overview
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]
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(other_stream) ⇒ WrappedStream
Create a new WrappedStream wrapping the Stream other_stream.
304
305
306
|
# File 'lib/stream.rb', line 304
def initialize(other_stream)
@wrapped_stream = other_stream
end
|
Instance Attribute Details
#wrapped_stream ⇒ Object
Returns the value of attribute wrapped_stream.
301
302
303
|
# File 'lib/stream.rb', line 301
def wrapped_stream
@wrapped_stream
end
|
Instance Method Details
#at_beginning? ⇒ Boolean
308
309
310
|
# File 'lib/stream.rb', line 308
def at_beginning?
@wrapped_stream.at_beginning?
end
|
#at_end? ⇒ Boolean
312
313
314
|
# File 'lib/stream.rb', line 312
def at_end?
@wrapped_stream.at_end?
end
|
#basic_backward ⇒ Object
333
334
335
|
# File 'lib/stream.rb', line 333
def basic_backward
@wrapped_stream.basic_backward
end
|
#basic_forward ⇒ Object
329
330
331
|
# File 'lib/stream.rb', line 329
def basic_forward
@wrapped_stream.basic_forward
end
|
#set_to_begin ⇒ Object
320
321
322
|
# File 'lib/stream.rb', line 320
def set_to_begin
@wrapped_stream.set_to_begin
end
|
#set_to_end ⇒ Object
316
317
318
|
# File 'lib/stream.rb', line 316
def set_to_end
@wrapped_stream.set_to_end
end
|
#unwrapped ⇒ Object
Returns the wrapped stream unwrapped.
325
326
327
|
# File 'lib/stream.rb', line 325
def unwrapped
@wrapped_stream.unwrapped
end
|