Class: Nocode::StepsExecutor
- Inherits:
-
Object
- Object
- Nocode::StepsExecutor
- Extended by:
- Forwardable
- Defined in:
- lib/nocode/steps_executor.rb
Overview
Class that knows how to execute a series of steps given a context.
Constant Summary collapse
- NAME_KEY =
'name'
- OPTIONS_KEY =
'options'
- TYPE_KEY =
'type'
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(context:, steps:) ⇒ StepsExecutor
constructor
A new instance of StepsExecutor.
Constructor Details
#initialize(context:, steps:) ⇒ StepsExecutor
Returns a new instance of StepsExecutor.
18 19 20 21 22 23 |
# File 'lib/nocode/steps_executor.rb', line 18 def initialize(context:, steps:) @context = context @steps = steps freeze end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
14 15 16 |
# File 'lib/nocode/steps_executor.rb', line 14 def context @context end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
14 15 16 |
# File 'lib/nocode/steps_executor.rb', line 14 def steps @steps end |
Instance Method Details
#execute ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/nocode/steps_executor.rb', line 25 def execute steps.each do |step| step_instance = make_step(step) execute_step(step_instance) end end |