Exception: StateMachineEnum::InvalidTransition
- Inherits:
-
InvalidState
- Object
- StandardError
- InvalidState
- StateMachineEnum::InvalidTransition
- Defined in:
- lib/state_machine_enum.rb
Instance Attribute Summary collapse
-
#attribute_name ⇒ Object
readonly
Returns the value of attribute attribute_name.
-
#from_state ⇒ Object
readonly
Returns the value of attribute from_state.
-
#to_state ⇒ Object
readonly
Returns the value of attribute to_state.
Instance Method Summary collapse
- #already_in_target_state? ⇒ Boolean
-
#initialize(attribute_name, attempted_transition_from_state, attempted_transition_to_state, *args_for_super) ⇒ InvalidTransition
constructor
A new instance of InvalidTransition.
Constructor Details
#initialize(attribute_name, attempted_transition_from_state, attempted_transition_to_state, *args_for_super) ⇒ InvalidTransition
Returns a new instance of InvalidTransition.
82 83 84 85 86 87 |
# File 'lib/state_machine_enum.rb', line 82 def initialize(attribute_name, attempted_transition_from_state, attempted_transition_to_state, *args_for_super) @attribute_name = attribute_name.to_s @from_state = attempted_transition_from_state.to_s @to_state = attempted_transition_to_state.to_s super(*args_for_super) end |
Instance Attribute Details
#attribute_name ⇒ Object (readonly)
Returns the value of attribute attribute_name.
76 77 78 |
# File 'lib/state_machine_enum.rb', line 76 def attribute_name @attribute_name end |
#from_state ⇒ Object (readonly)
Returns the value of attribute from_state.
76 77 78 |
# File 'lib/state_machine_enum.rb', line 76 def from_state @from_state end |
#to_state ⇒ Object (readonly)
Returns the value of attribute to_state.
76 77 78 |
# File 'lib/state_machine_enum.rb', line 76 def to_state @to_state end |
Instance Method Details
#already_in_target_state? ⇒ Boolean
78 79 80 |
# File 'lib/state_machine_enum.rb', line 78 def already_in_target_state? @from_state == @to_state end |