Exception: LifecycleVM::VM::InvalidState
- Defined in:
- lib/lifecycle_vm/vm.rb
Overview
Error raised if the machine attempts to enter a state not declared with .on
Instance Attribute Summary collapse
-
#state ⇒ Symbol
readonly
The name of the state that was attempted.
-
#vm ⇒ LifecycleVM::VM
readonly
The state machine being executed.
Instance Method Summary collapse
-
#initialize(state, vm) ⇒ InvalidState
constructor
A new instance of InvalidState.
Constructor Details
#initialize(state, vm) ⇒ InvalidState
Returns a new instance of InvalidState.
73 74 75 76 77 |
# File 'lib/lifecycle_vm/vm.rb', line 73 def initialize(state, vm) @state = state @vm = vm super("Invalid state transition to #{@state}. Current context #{@vm}") end |
Instance Attribute Details
#state ⇒ Symbol (readonly)
Returns the name of the state that was attempted.
66 67 68 |
# File 'lib/lifecycle_vm/vm.rb', line 66 def state @state end |
#vm ⇒ LifecycleVM::VM (readonly)
Returns the state machine being executed.
69 70 71 |
# File 'lib/lifecycle_vm/vm.rb', line 69 def vm @vm end |