Exception: PgVerify::Interpret::NoSuchStateError
- Inherits:
-
Core::Error
- Object
- StandardError
- Core::Error
- PgVerify::Interpret::NoSuchStateError
- Defined in:
- lib/pg-verify/interpret/interpret.rb
Instance Method Summary collapse
- #formatted ⇒ Object
-
#initialize(state, component) ⇒ NoSuchStateError
constructor
A new instance of NoSuchStateError.
Methods inherited from Core::Error
Constructor Details
#initialize(state, component) ⇒ NoSuchStateError
Returns a new instance of NoSuchStateError.
114 115 116 |
# File 'lib/pg-verify/interpret/interpret.rb', line 114 def initialize(state, component) @state, @component = state, component end |
Instance Method Details
#formatted ⇒ Object
117 118 119 120 121 122 123 |
# File 'lib/pg-verify/interpret/interpret.rb', line 117 def formatted() title = "No such state #{@state} in component #{@component.name}" body = "The component #{@component.name.to_s.c_cmp} does not contain a state called #{@state.to_s.c_state}.\n" body += "Available states are: #{@component.states&.map(&:to_s)&.map(&:c_state)&.join(', ')}" hint = "Make sure to define states before defining transitions." return title, body, hint end |