Exception: StateMachineEnum::InvalidTransition

Inherits:
InvalidState
  • Object
show all
Defined in:
lib/state_machine_enum.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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_stateObject (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_stateObject (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

Returns:

  • (Boolean)


78
79
80
# File 'lib/state_machine_enum.rb', line 78

def already_in_target_state?
  @from_state == @to_state
end