Class: FastRuby::Pipeline
Instance Method Summary collapse
- #<<(object) ⇒ Object
- #call(arg) ⇒ Object
-
#initialize ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize ⇒ Pipeline
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 |