Class: Igniter::Extensions::Contracts::Saga::CompensationRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/igniter/extensions/contracts/saga/compensation_record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node_name:, success:, error: nil) ⇒ CompensationRecord

Returns a new instance of CompensationRecord.



10
11
12
13
14
15
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 10

def initialize(node_name:, success:, error: nil)
  @node_name = node_name.to_sym
  @success = success
  @error = error
  freeze
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



8
9
10
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 8

def error
  @error
end

#node_nameObject (readonly)

Returns the value of attribute node_name.



8
9
10
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 8

def node_name
  @node_name
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 21

def failed?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 17

def success?
  @success
end