Class: FastRuby::Pipeline

Inherits:
Object show all
Defined in:
lib/fastruby/builder/pipeline.rb

Instance Method Summary collapse

Constructor Details

#initializePipeline

Returns a new instance of Pipeline.



25
26
27
# File 'lib/fastruby/builder/pipeline.rb', line 25

def initialize
  @array = Array.new
end

Instance Method Details

#<<(object) ⇒ Object



29
30
31
# File 'lib/fastruby/builder/pipeline.rb', line 29

def << (object)
  @array << object
end

#call(arg) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/fastruby/builder/pipeline.rb', line 33

def call(arg)
  
  last_result = arg 
  @array.each do |processor|
    last_result = processor.call(last_result)
  end
  
  last_result
end