Class: Pipetree::Railway::Strut
- Inherits:
-
Object
- Object
- Pipetree::Railway::Strut
- Defined in:
- lib/pipetree/railway.rb
Instance Method Summary collapse
- #call(last, input, options) ⇒ Object
-
#initialize(proc, config = {}) ⇒ Strut
constructor
A new instance of Strut.
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, ) result = @proc.(input, ) # call the actual step. [self.class::Decider.(result, @config, last, input, ), input] # decide about the track and return Flow-compliant response. end |