Exception: StatePattern::InvalidTransitionException
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- StatePattern::InvalidTransitionException
- Defined in:
- lib/state_pattern/invalid_transition_exception.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#from_module ⇒ Object
readonly
Returns the value of attribute from_module.
-
#to_module ⇒ Object
readonly
Returns the value of attribute to_module.
Instance Method Summary collapse
-
#initialize(from_module, to_module, event) ⇒ InvalidTransitionException
constructor
A new instance of InvalidTransitionException.
- #message ⇒ Object
Constructor Details
#initialize(from_module, to_module, event) ⇒ InvalidTransitionException
Returns a new instance of InvalidTransitionException.
4 5 6 7 8 |
# File 'lib/state_pattern/invalid_transition_exception.rb', line 4 def initialize(from_module, to_module, event) @from_module = from_module @to_module = to_module @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
3 4 5 |
# File 'lib/state_pattern/invalid_transition_exception.rb', line 3 def event @event end |
#from_module ⇒ Object (readonly)
Returns the value of attribute from_module.
3 4 5 |
# File 'lib/state_pattern/invalid_transition_exception.rb', line 3 def from_module @from_module end |
#to_module ⇒ Object (readonly)
Returns the value of attribute to_module.
3 4 5 |
# File 'lib/state_pattern/invalid_transition_exception.rb', line 3 def to_module @to_module end |
Instance Method Details
#message ⇒ Object
10 11 12 |
# File 'lib/state_pattern/invalid_transition_exception.rb', line 10 def "Event #@event cannot transition from #@from_module to #@to_module" end |