Exception: EnumMachine::InvalidTransition
- Defined in:
- lib/enum_machine.rb
Instance Attribute Summary collapse
-
#enum_const ⇒ Object
readonly
Returns the value of attribute enum_const.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(machine, from, to) ⇒ InvalidTransition
constructor
A new instance of InvalidTransition.
Constructor Details
#initialize(machine, from, to) ⇒ InvalidTransition
Returns a new instance of InvalidTransition.
19 20 21 22 23 24 |
# File 'lib/enum_machine.rb', line 19 def initialize(machine, from, to) @from = from @to = to @enum_const = machine.base_klass.const_get(machine.enum_const_name) super "Transition #{from.inspect} => #{to.inspect} not defined in enum_machine #{enum_const.name}" end |
Instance Attribute Details
#enum_const ⇒ Object (readonly)
Returns the value of attribute enum_const.
17 18 19 |
# File 'lib/enum_machine.rb', line 17 def enum_const @enum_const end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
17 18 19 |
# File 'lib/enum_machine.rb', line 17 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
17 18 19 |
# File 'lib/enum_machine.rb', line 17 def to @to end |