Class: Porch::ExecutableStepDecorator
- Inherits:
-
Object
- Object
- Porch::ExecutableStepDecorator
- Defined in:
- lib/porch/executable_step_decorator.rb
Instance Attribute Summary collapse
-
#decorated_step ⇒ Object
readonly
Returns the value of attribute decorated_step.
Class Method Summary collapse
Instance Method Summary collapse
- #execute(context) ⇒ Object
-
#initialize(step, organizer) ⇒ ExecutableStepDecorator
constructor
A new instance of ExecutableStepDecorator.
- #step ⇒ Object
Constructor Details
#initialize(step, organizer) ⇒ ExecutableStepDecorator
Returns a new instance of ExecutableStepDecorator.
13 14 15 |
# File 'lib/porch/executable_step_decorator.rb', line 13 def initialize(step, organizer) @decorated_step = decorate step, organizer end |
Instance Attribute Details
#decorated_step ⇒ Object (readonly)
Returns the value of attribute decorated_step.
7 8 9 |
# File 'lib/porch/executable_step_decorator.rb', line 7 def decorated_step @decorated_step end |
Class Method Details
.registered_decorators ⇒ Object
26 27 28 |
# File 'lib/porch/executable_step_decorator.rb', line 26 def self.registered_decorators [ClassStepDecorator, MethodStepDecorator, ProcStepDecorator].freeze end |
Instance Method Details
#execute(context) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/porch/executable_step_decorator.rb', line 17 def execute(context) begin decorated_step.execute context rescue Porch::ContextStoppedError => e # this exception is just used for flow control e.context end end |
#step ⇒ Object
9 10 11 |
# File 'lib/porch/executable_step_decorator.rb', line 9 def step decorated_step.step end |