Exception: LifecycleVM::VM::InvalidState

Inherits:
Error
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(state, vm) ⇒ 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

#stateSymbol (readonly)



66
67
68
# File 'lib/lifecycle_vm/vm.rb', line 66

def state
  @state
end

#vmLifecycleVM::VM (readonly)



69
70
71
# File 'lib/lifecycle_vm/vm.rb', line 69

def vm
  @vm
end