Class: Fall::StreamOperationPipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/fall/stream_operation_pipeline.rb

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ StreamOperationPipeline

Returns a new instance of StreamOperationPipeline.



3
4
5
6
# File 'lib/fall/stream_operation_pipeline.rb', line 3

def initialize(source)
  @source = source
  @operation = StreamOperation.new(->(stream) { stream })
end

Instance Method Details

#add_operation(operation) ⇒ Object Also known as: add_stream_operation



8
9
10
# File 'lib/fall/stream_operation_pipeline.rb', line 8

def add_operation(operation)
  @operation = @operation.chain(operation)
end

#to_enumObject



14
15
16
# File 'lib/fall/stream_operation_pipeline.rb', line 14

def to_enum
  @operation.call(@source)
end