Exception: Ibex::Runtime::CST::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Ibex::Runtime::CST::ValidationError
- Defined in:
- lib/ibex/runtime/cst/validator.rb,
sig/ibex/runtime/cst/validator.rbs
Overview
Structured failure raised for an invalid or incompatible CST document.
Instance Attribute Summary collapse
- #actual ⇒ Object readonly
- #code ⇒ Symbol readonly
- #expected ⇒ Object readonly
- #path ⇒ String readonly
Instance Method Summary collapse
-
#initialize(code:, path:, message:, expected: nil, actual: nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(code:, path:, message:, expected: nil, actual: nil) ⇒ ValidationError
Returns a new instance of ValidationError.
17 18 19 20 21 22 23 |
# File 'lib/ibex/runtime/cst/validator.rb', line 17 def initialize(code:, path:, message:, expected: nil, actual: nil) @code = code @path = path.dup.freeze @expected = expected @actual = actual super("(cst):#{path}: #{}") end |
Instance Attribute Details
#actual ⇒ Object (readonly)
14 15 16 |
# File 'lib/ibex/runtime/cst/validator.rb', line 14 def actual @actual end |
#code ⇒ Symbol (readonly)
11 12 13 |
# File 'lib/ibex/runtime/cst/validator.rb', line 11 def code @code end |
#expected ⇒ Object (readonly)
13 14 15 |
# File 'lib/ibex/runtime/cst/validator.rb', line 13 def expected @expected end |
#path ⇒ String (readonly)
12 13 14 |
# File 'lib/ibex/runtime/cst/validator.rb', line 12 def path @path end |