Module: RubyReactor::Step::ClassMethods

Includes:
RubyReactor::StepSignals
Defined in:
lib/ruby_reactor/step.rb

Constant Summary

Constants included from RubyReactor::StepSignals

RubyReactor::StepSignals::TAG

Instance Method Summary collapse

Methods included from RubyReactor::StepSignals

#fail!, #halt!, #skip!, #success!

Instance Method Details

#compensate(_reason, _arguments, _context) ⇒ Object



34
35
36
# File 'lib/ruby_reactor/step.rb', line 34

def compensate(_reason, _arguments, _context)
  RubyReactor.Skipped() # Default: nothing defined, rollback continues
end

#Failure(error = nil) ⇒ Object



17
18
19
# File 'lib/ruby_reactor/step.rb', line 17

def Failure(error = nil)
  RubyReactor::Failure(error)
end

#Halt(reason: nil, **kwargs) ⇒ Object



21
22
23
# File 'lib/ruby_reactor/step.rb', line 21

def Halt(reason: nil, **kwargs)
  RubyReactor.Halt(reason: reason, **kwargs)
end

#run(arguments, context) ⇒ Object

rubocop:enable Naming/MethodName

Raises:



30
31
32
# File 'lib/ruby_reactor/step.rb', line 30

def run(arguments, context)
  raise NotImplementedError, "#{self} must implement .run method"
end

#SkippedObject



25
26
27
# File 'lib/ruby_reactor/step.rb', line 25

def Skipped(...)
  RubyReactor.Skipped(...)
end

#Success(value = nil) ⇒ Object

rubocop:disable Naming/MethodName



13
14
15
# File 'lib/ruby_reactor/step.rb', line 13

def Success(value = nil)
  RubyReactor::Success(value)
end

#undo(_result, _arguments, _context) ⇒ Object



38
39
40
# File 'lib/ruby_reactor/step.rb', line 38

def undo(_result, _arguments, _context)
  RubyReactor.Skipped() # Default: nothing defined, rollback continues
end