Class: Yaso::Logic::Failure

Inherits:
Base
  • Object
show all
Defined in:
lib/yaso/logic/failure.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
# File 'lib/yaso/logic/failure.rb', line 6

def call(context, instance)
  instance.success = false
  @invocable.call(context, instance) ? @next_step : @failure
end