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.



6
7
8
9
# File 'lib/business_flow/default_step_executor.rb', line 6

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

Instance Method Details

#callObject



11
12
13
14
15
16
# File 'lib/business_flow/default_step_executor.rb', line 11

def call
  @step_queue.each do |step|
    break if @flow.errors?
    execute_step(step)
  end
end