Class: Hecks::Runtime::Dispatcher::Result
- Inherits:
-
Struct
- Object
- Struct
- Hecks::Runtime::Dispatcher::Result
- Defined in:
- lib/hecks/runtime/dispatcher.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#execution_plan ⇒ Object
Returns the value of attribute execution_plan.
-
#instance ⇒ Object
Returns the value of attribute instance.
-
#persistence_outcome ⇒ Object
Returns the value of attribute persistence_outcome.
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#id ⇒ Object
instanceis nil for a port operation dispatched by verb (below) — nothing was hydrated or saved, the same reasonPortOperationInterpreter#emit's own comment gives for sourcingid:off the operation's reference attribute instead. - #inspect ⇒ Object
- #state ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events
19 20 21 |
# File 'lib/hecks/runtime/dispatcher.rb', line 19 def events @events end |
#execution_plan ⇒ Object
Returns the value of attribute execution_plan
19 20 21 |
# File 'lib/hecks/runtime/dispatcher.rb', line 19 def execution_plan @execution_plan end |
#instance ⇒ Object
Returns the value of attribute instance
19 20 21 |
# File 'lib/hecks/runtime/dispatcher.rb', line 19 def instance @instance end |
#persistence_outcome ⇒ Object
Returns the value of attribute persistence_outcome
19 20 21 |
# File 'lib/hecks/runtime/dispatcher.rb', line 19 def persistence_outcome @persistence_outcome end |
#verb ⇒ Object
Returns the value of attribute verb
19 20 21 |
# File 'lib/hecks/runtime/dispatcher.rb', line 19 def verb @verb end |
Instance Method Details
#id ⇒ Object
instance is nil for a port operation dispatched by verb (below)
— nothing was hydrated or saved, the same reason
PortOperationInterpreter#emit's own comment gives for sourcing
id: off the operation's reference attribute instead. &., not
a raised error: a caller that dispatches a port verb and then
asks this Result for .id/.state made a category error the
domain itself already told it about (there is no record here),
not a crash-worthy one.
28 |
# File 'lib/hecks/runtime/dispatcher.rb', line 28 def id = instance&.id |
#inspect ⇒ Object
36 |
# File 'lib/hecks/runtime/dispatcher.rb', line 36 def inspect = "#<Result #{self}>" |
#state ⇒ Object
29 |
# File 'lib/hecks/runtime/dispatcher.rb', line 29 def state = instance&.to_h |
#to_s ⇒ Object
31 32 33 34 |
# File 'lib/hecks/runtime/dispatcher.rb', line 31 def to_s announced = events.empty? ? "no events" : events.map(&:name).join(", ") "#{verb} → #{instance.inspect} | #{announced}" end |