Class: Igniter::Extensions::Contracts::Saga::CompensationRecord
- Inherits:
-
Object
- Object
- Igniter::Extensions::Contracts::Saga::CompensationRecord
- Defined in:
- lib/igniter/extensions/contracts/saga/compensation_record.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#node_name ⇒ Object
readonly
Returns the value of attribute node_name.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(node_name:, success:, error: nil) ⇒ CompensationRecord
constructor
A new instance of CompensationRecord.
- #success? ⇒ Boolean
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
#error ⇒ Object (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_name ⇒ Object (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
21 22 23 |
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 21 def failed? !success? end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/igniter/extensions/contracts/saga/compensation_record.rb', line 17 def success? @success end |