Exception: Statecraft::TransitionConflict
- Defined in:
- lib/statecraft/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expected_from ⇒ Object
readonly
Returns the value of attribute expected_from.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
-
#initialize(record:, expected_from:, message: nil) ⇒ TransitionConflict
constructor
A new instance of TransitionConflict.
Constructor Details
#initialize(record:, expected_from:, message: nil) ⇒ TransitionConflict
Returns a new instance of TransitionConflict.
41 42 43 44 45 46 |
# File 'lib/statecraft/errors.rb', line 41 def initialize(record:, expected_from:, message: nil) @record = record @expected_from = expected_from super( || "concurrent update detected for #{record.class.name}##{record.id}: " \ "expected state #{expected_from.inspect}, another writer got there first") end |
Instance Attribute Details
#expected_from ⇒ Object (readonly)
Returns the value of attribute expected_from.
39 40 41 |
# File 'lib/statecraft/errors.rb', line 39 def expected_from @expected_from end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
39 40 41 |
# File 'lib/statecraft/errors.rb', line 39 def record @record end |