Class: BusinessFlow::DefaultStepExecutor

Inherits:
Object
  • Object
show all
Defined in:
lib/business_flow/default_step_executor.rb

Overview

Default behavior for running a step queue – execute each step in turn halting the moment something goes wrong. Use the same flow as input and output to all steps.

Direct Known Subclasses

InstrumentedExecutor

Instance Method Summary collapse

Constructor Details

#initialize(step_queue, flow) ⇒ DefaultStepExecutor

Returns a new instance of DefaultStepExecutor.



8
9
10
11
# File 'lib/business_flow/default_step_executor.rb', line 8

def initialize(step_queue, flow)
  @step_queue = step_queue
  @flow = flow
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
# File 'lib/business_flow/default_step_executor.rb', line 13

def call
  @step_queue.each do |step|
    break if @flow.errors?

    execute_step(step)
  end
end