Module: Teckel::Chain
- Defined in:
- lib/teckel/chain.rb
Overview
Railway style execution of multiple Operations.
-
Runs multiple Operations (steps) in order.
-
The output of an earlier step is passed as input to the next step.
-
Any failure will stop the execution chain (none of the later steps is called).
-
All Operations (steps) must behave like
Teckel::Operation::Resultsand return a result object likeTeckel::Result -
A failure response is wrapped into a
Teckel::Chain::StepFailuregiving additional information about which step failed
Defined Under Namespace
Modules: ClassMethods, InstanceMethods Classes: StepFailure
Class Method Summary collapse
Class Method Details
.included(receiver) ⇒ Object
177 178 179 180 181 182 183 184 |
# File 'lib/teckel/chain.rb', line 177 def self.included(receiver) receiver.extend ClassMethods receiver.send :include, InstanceMethods receiver.class_eval do @steps = [] end end |