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 =
%i[inserted replaced updated conflicted missing saved].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.
8 9 10 11 12 13 14 |
# File 'lib/hecks/ports/persistence/execution.rb', line 8 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 |