class BSFlow::Pipeline

Public Class Methods

new(*args, procs: []) click to toggle source
# File lib/bsflow/pipeline.rb, line 3
def initialize(*args, procs: [])
  @procs = args + procs
end

Public Instance Methods

call(*args) click to toggle source
# File lib/bsflow/pipeline.rb, line 7
def call(*args)
  output = @procs[0].call(*args)
  if @procs.length == 1
    return output
  else
    @procs[1..-1].each do |proc|
      output = proc.call(output)
    end
    output
  end
end