Class: Evinrude::StateMachine::Register
- Inherits:
-
Evinrude::StateMachine
- Object
- Evinrude::StateMachine
- Evinrude::StateMachine::Register
- Defined in:
- lib/evinrude/state_machine/register.rb
Instance Method Summary collapse
- #current_state ⇒ Object
-
#initialize(**kwargs) ⇒ Register
constructor
A new instance of Register.
- #process_command(s) ⇒ Object
- #snapshot ⇒ Object
Constructor Details
#initialize(**kwargs) ⇒ Register
Returns a new instance of Register.
6 7 8 9 10 |
# File 'lib/evinrude/state_machine/register.rb', line 6 def initialize(**kwargs) super @state = kwargs.fetch(:snapshot, "") end |
Instance Method Details
#current_state ⇒ Object
16 17 18 |
# File 'lib/evinrude/state_machine/register.rb', line 16 def current_state @state end |
#process_command(s) ⇒ Object
12 13 14 |
# File 'lib/evinrude/state_machine/register.rb', line 12 def process_command(s) @state = s end |
#snapshot ⇒ Object
20 21 22 |
# File 'lib/evinrude/state_machine/register.rb', line 20 def snapshot @state end |