Class: Eatr::Pipeline
- Inherits:
-
Object
- Object
- Eatr::Pipeline
- Defined in:
- lib/eatr/pipeline.rb
Instance Method Summary collapse
- #call(row) ⇒ Object
-
#initialize(steps) ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize(steps) ⇒ Pipeline
Returns a new instance of Pipeline.
3 4 5 |
# File 'lib/eatr/pipeline.rb', line 3 def initialize(steps) @steps = steps end |
Instance Method Details
#call(row) ⇒ Object
7 8 9 |
# File 'lib/eatr/pipeline.rb', line 7 def call(row) @steps.reduce(row) { |memo, step| step.call(memo) } end |