Class: Yaso::Flows::Classic

Inherits:
Object
  • Object
show all
Defined in:
lib/yaso/flows/classic.rb

Direct Known Subclasses

Rollback

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, steps) ⇒ Classic

Returns a new instance of Classic.



8
9
10
11
12
# File 'lib/yaso/flows/classic.rb', line 8

def initialize(klass, steps)
  @klass = klass
  @steps = steps
  @step_builder = StepBuilder.new(klass)
end

Class Method Details

.call(klass, steps) ⇒ Object



4
5
6
# File 'lib/yaso/flows/classic.rb', line 4

def self.call(klass, steps)
  new(klass, steps).call
end

Instance Method Details

#callObject



14
15
16
17
# File 'lib/yaso/flows/classic.rb', line 14

def call
  logicals.each_with_index { |step, i| step.is_a?(Steps::Failure) ? link_failure(step, i) : link_step(step, i) }
  logicals.first
end