Class: Hecks::Ports::Persistence::Outcome
- Inherits:
-
Struct
- Object
- Struct
- Hecks::Ports::Persistence::Outcome
- Defined in:
- lib/hecks/ports/persistence/execution.rb
Overview
Adapter outcomes are runtime facts, never command lifecycle.
Constant Summary collapse
- STATUSES =
:staleis an optimistic-concurrency conflict on a plainsave(someone else committed since this instance was read) — never a domain refusal, distinct from:conflicted(acreates?command's identity already exists,AlreadyExists). SeeRuntime::StaleWrite(runtime/errors.rb) andAppendOnly#save. %i[inserted replaced updated conflicted missing saved stale].freeze
Instance Attribute Summary collapse
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, instance: nil) ⇒ Outcome
constructor
A new instance of Outcome.
Constructor Details
#initialize(status:, instance: nil) ⇒ Outcome
Returns a new instance of Outcome.
13 14 15 16 17 18 19 |
# File 'lib/hecks/ports/persistence/execution.rb', line 13 def initialize(status:, instance: nil) normalized = status.to_sym raise ArgumentError, "unknown persistence outcome #{status.inspect}" unless STATUSES.include?(normalized) super(status: normalized, instance: instance) freeze end |
Instance Attribute Details
#instance ⇒ Object
Returns the value of attribute instance
5 6 7 |
# File 'lib/hecks/ports/persistence/execution.rb', line 5 def instance @instance end |
#status ⇒ Object
Returns the value of attribute status
5 6 7 |
# File 'lib/hecks/ports/persistence/execution.rb', line 5 def status @status end |