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 ⇒ json_value readonly
- #code ⇒ Symbol readonly
- #expected ⇒ json_value 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.
21 22 23 24 25 26 27 |
# File 'lib/ibex/runtime/cst/validator.rb', line 21 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 ⇒ json_value (readonly)
18 19 20 |
# File 'lib/ibex/runtime/cst/validator.rb', line 18 def actual @actual end |
#code ⇒ Symbol (readonly)
15 16 17 |
# File 'lib/ibex/runtime/cst/validator.rb', line 15 def code @code end |
#expected ⇒ json_value (readonly)
17 18 19 |
# File 'lib/ibex/runtime/cst/validator.rb', line 17 def expected @expected end |
#path ⇒ String (readonly)
16 17 18 |
# File 'lib/ibex/runtime/cst/validator.rb', line 16 def path @path end |