Class: Germinate::Pipeline
- Inherits:
-
Object
- Object
- Germinate::Pipeline
- Defined in:
- lib/germinate/pipeline.rb
Instance Attribute Summary collapse
-
#processes ⇒ Object
readonly
Returns the value of attribute processes.
Instance Method Summary collapse
- #call(input) ⇒ Object
-
#initialize(processes) ⇒ Pipeline
constructor
A new instance of Pipeline.
Constructor Details
#initialize(processes) ⇒ Pipeline
Returns a new instance of Pipeline.
4 5 6 |
# File 'lib/germinate/pipeline.rb', line 4 def initialize(processes) @processes = processes end |
Instance Attribute Details
#processes ⇒ Object (readonly)
Returns the value of attribute processes.
2 3 4 |
# File 'lib/germinate/pipeline.rb', line 2 def processes @processes end |
Instance Method Details
#call(input) ⇒ Object
8 9 10 11 12 |
# File 'lib/germinate/pipeline.rb', line 8 def call(input) @processes.inject(input) { |output, process| process.call(output) } end |