Class: Yaso::Logic::Classic

Inherits:
Object
  • Object
show all
Defined in:
lib/yaso/logic/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.



10
11
12
13
14
# File 'lib/yaso/logic/classic.rb', line 10

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

Class Method Details

.call(klass, steps) ⇒ Object



6
7
8
# File 'lib/yaso/logic/classic.rb', line 6

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

Instance Method Details

#callObject



16
17
18
19
# File 'lib/yaso/logic/classic.rb', line 16

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