Class: Pipetree::Railway::Strut

Inherits:
Object
  • Object
show all
Defined in:
lib/pipetree/railway.rb

Direct Known Subclasses

And, Stay

Instance Method Summary collapse

Constructor Details

#initialize(proc, config = {}) ⇒ Strut

Returns a new instance of Strut.



71
72
73
74
# File 'lib/pipetree/railway.rb', line 71

def initialize(proc, config={})
  @proc    = proc
  @config  = config
end

Instance Method Details

#call(last, input, options) ⇒ Object



76
77
78
79
80
# File 'lib/pipetree/railway.rb', line 76

def call(last, input, options)
  result = @proc.(input, options) # call the actual step.

  [self.class::Decider.(result, @config, last, input, options), input] # decide about the track and return Flow-compliant response.
end