Class: Germinate::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/germinate/pipeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#processesObject (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