Class: Plutonium::Interaction::Concerns::WorkflowDSL::WorkflowBuilder
- Inherits:
-
Object
- Object
- Plutonium::Interaction::Concerns::WorkflowDSL::WorkflowBuilder
- Defined in:
- lib/plutonium/interaction/concerns/workflow_dsl.rb
Overview
Helper class for building workflows.
Instance Method Summary collapse
-
#initialize(use_case_class) ⇒ WorkflowBuilder
constructor
A new instance of WorkflowBuilder.
-
#step(name, use_case, if: nil) ⇒ Object
Adds a step to the workflow.
Constructor Details
#initialize(use_case_class) ⇒ WorkflowBuilder
Returns a new instance of WorkflowBuilder.
46 47 48 |
# File 'lib/plutonium/interaction/concerns/workflow_dsl.rb', line 46 def initialize(use_case_class) @use_case_class = use_case_class end |
Instance Method Details
#step(name, use_case, if: nil) ⇒ Object
Adds a step to the workflow.
55 56 57 58 59 60 61 |
# File 'lib/plutonium/interaction/concerns/workflow_dsl.rb', line 55 def step(name, use_case, if: nil) @use_case_class.workflow_steps << { name:, use_case:, condition: binding.local_variable_get(:if) } end |