Class: Yaso::Logic::Classic
- Inherits:
-
Object
- Object
- Yaso::Logic::Classic
- Defined in:
- lib/yaso/logic/classic.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(klass, steps) ⇒ Classic
constructor
A new instance of Classic.
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
#call ⇒ Object
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 |