Class: Temporal::Saga::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/temporal/saga/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(completed, rollback_reason = nil) ⇒ Result

Returns a new instance of Result.



6
7
8
9
10
11
# File 'lib/temporal/saga/result.rb', line 6

def initialize(completed, rollback_reason = nil)
  @completed = completed
  @rollback_reason = rollback_reason

  freeze
end

Instance Attribute Details

#rollback_reasonObject (readonly)

Returns the value of attribute rollback_reason.



4
5
6
# File 'lib/temporal/saga/result.rb', line 4

def rollback_reason
  @rollback_reason
end

Instance Method Details

#compensated?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/temporal/saga/result.rb', line 17

def compensated?
  !completed?
end

#completed?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/temporal/saga/result.rb', line 13

def completed?
  @completed
end