Class: Hecks::Bluebook::Saga
- Inherits:
-
Struct
- Object
- Struct
- Hecks::Bluebook::Saga
- Defined in:
- lib/hecks/bluebook/process_manager.rb
Overview
The compensation half of a procedure, as its own thing.
A PROCESS MANAGER coordinates: legs, states, an opinion about who goes next. A SAGA undoes: what makes the world good again when a leg it dispatched is refused. Two concepts, and the industry slurs them into one word — so here they are two objects, and a procedure either has a saga or does not.
undoes is the ordered list of commands the compensation sends. Today that
order is the AUTHOR's, written by hand in one on :refused leg, and the
runtime does not know which legs actually completed. When compensation
moves beside each dispatch — reverses on the step it reverses — this is
where the completed ones, newest first, will live. The shape is already
right for it; only the source of the order changes.
Instance Attribute Summary collapse
-
#from_state ⇒ Object
Returns the value of attribute from_state.
-
#reversals ⇒ Object
Returns the value of attribute reversals.
-
#to_state ⇒ Object
Returns the value of attribute to_state.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
Instance Method Summary collapse
Instance Attribute Details
#from_state ⇒ Object
Returns the value of attribute from_state
44 45 46 |
# File 'lib/hecks/bluebook/process_manager.rb', line 44 def from_state @from_state end |
#reversals ⇒ Object
Returns the value of attribute reversals
44 45 46 |
# File 'lib/hecks/bluebook/process_manager.rb', line 44 def reversals @reversals end |
#to_state ⇒ Object
Returns the value of attribute to_state
44 45 46 |
# File 'lib/hecks/bluebook/process_manager.rb', line 44 def to_state @to_state end |
#trigger ⇒ Object
Returns the value of attribute trigger
44 45 46 |
# File 'lib/hecks/bluebook/process_manager.rb', line 44 def trigger @trigger end |
Instance Method Details
#to_s ⇒ Object
47 |
# File 'lib/hecks/bluebook/process_manager.rb', line 47 def to_s = "#{trigger} → #{to_state} (#{undoes.join(', ')})" |
#undoes ⇒ Object
45 |
# File 'lib/hecks/bluebook/process_manager.rb', line 45 def undoes = reversals.map(&:command_name) |