Class: Roast::Workflow::StepFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/roast/workflow/step_factory.rb

Overview

Factory for creating step instances based on step characteristics

Class Method Summary collapse

Class Method Details

.create(workflow, step_name, options = {}) ⇒ BaseStep

Create a step instance based on the step type and characteristics

Parameters:

  • workflow (BaseWorkflow)

    The workflow instance

  • step_name (String, StepName)

    The name of the step

  • options (Hash) (defaults to: {})

    Additional options for step creation

Returns:

  • (BaseStep)

    The appropriate step instance



14
15
16
17
18
19
20
21
22
# File 'lib/roast/workflow/step_factory.rb', line 14

def create(workflow, step_name, options = {})
  name = normalize_step_name(step_name)

  # Determine the step class based on characteristics
  step_class = determine_step_class(name, options)

  # Create the step instance with appropriate parameters
  build_step_instance(step_class, workflow, name, options)
end