Class: Smith::Workflow::FailureRecord

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/smith/workflow/failure_record.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.capture(step_result) ⇒ Object



39
# File 'lib/smith/workflow/failure_record.rb', line 39

def self.capture(step_result) = new(step_result:).call

Instance Method Details

#callObject



41
42
43
44
45
46
47
48
49
# File 'lib/smith/workflow/failure_record.rb', line 41

def call
  error = step_result.fetch(:error)
  {
    transition: step_result[:transition],
    from: step_result[:from],
    to: step_result[:to],
    **error_attributes(error)
  }.freeze
end