Exception: Statecraft::InvalidTransition
- Defined in:
- lib/statecraft/errors.rb
Instance Attribute Summary collapse
-
#allowed ⇒ Object
readonly
Returns the value of attribute allowed.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#requested ⇒ Object
readonly
Returns the value of attribute requested.
Instance Method Summary collapse
-
#initialize(record:, from:, requested:, allowed:, message: nil) ⇒ InvalidTransition
constructor
A new instance of InvalidTransition.
Constructor Details
#initialize(record:, from:, requested:, allowed:, message: nil) ⇒ InvalidTransition
Returns a new instance of InvalidTransition.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/statecraft/errors.rb', line 26 def initialize(record:, from:, requested:, allowed:, message: nil) @record = record @from = from @requested = requested @allowed = allowed = "transition #{from} -> #{requested} is not declared for " \ "#{record.class.name}; allowed from #{from}: " \ "#{allowed.empty? ? "none" : allowed.join(", ")}" super( || ) end |
Instance Attribute Details
#allowed ⇒ Object (readonly)
Returns the value of attribute allowed.
24 25 26 |
# File 'lib/statecraft/errors.rb', line 24 def allowed @allowed end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
24 25 26 |
# File 'lib/statecraft/errors.rb', line 24 def from @from end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
24 25 26 |
# File 'lib/statecraft/errors.rb', line 24 def record @record end |
#requested ⇒ Object (readonly)
Returns the value of attribute requested.
24 25 26 |
# File 'lib/statecraft/errors.rb', line 24 def requested @requested end |