Class: Yaso::Logic::Step

Inherits:
Base
  • Object
show all
Defined in:
lib/yaso/logic/step.rb

Instance Attribute Summary

Attributes inherited from Base

#name, #on_failure, #on_success

Instance Method Summary collapse

Methods inherited from Base

#add_failure, #add_next_step, #initialize

Constructor Details

This class inherits a constructor from Yaso::Logic::Base

Instance Method Details

#call(context, instance) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/yaso/logic/step.rb', line 6

def call(context, instance)
  instance.success = true
  if @invocable.call(context, instance)
    @next_step
  else
    instance.success = false
    @failure
  end
end