Class: Stages::Splice

Inherits:
Stage
  • Object
show all
Defined in:
lib/stages/splice.rb

Instance Attribute Summary

Attributes inherited from Stage

#source

Instance Method Summary collapse

Methods inherited from Stage

#die, #done?, #drop_leftmost!, #each, #end?, #handle_value, #initialize_loop, #input, #length, #output, #root_source, #run, #source_empty?, #to_enum, #|

Constructor Details

#initialize(*args, &block) ⇒ Splice



3
4
5
6
# File 'lib/stages/splice.rb', line 3

def initialize(*args, &block)
  @pipelines = args
  super()
end

Instance Method Details

#processObject



8
9
10
11
12
13
14
15
# File 'lib/stages/splice.rb', line 8

def process
  @pipelines.each do |pipeline|
    pipeline.each do |item|
      handle_value item
    end
  end
  super()
end

#resetObject



17
18
19
20
# File 'lib/stages/splice.rb', line 17

def reset
  @pipelines.each{ |pipeline| pipeline.reset }
  super()
end