Exception: Ibex::Runtime::CST::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Ibex::Runtime::CST::ValidationError
- Defined in:
- lib/ibex/runtime/cst/validator.rb
Overview
Structured failure raised for an invalid or incompatible CST document.
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
: json_value.
-
#code ⇒ Object
readonly
: Symbol.
-
#expected ⇒ Object
readonly
: json_value.
-
#path ⇒ Object
readonly
: String.
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 ⇒ Object (readonly)
: json_value
18 19 20 |
# File 'lib/ibex/runtime/cst/validator.rb', line 18 def actual @actual end |
#code ⇒ Object (readonly)
: Symbol
15 16 17 |
# File 'lib/ibex/runtime/cst/validator.rb', line 15 def code @code end |
#expected ⇒ Object (readonly)
: json_value
17 18 19 |
# File 'lib/ibex/runtime/cst/validator.rb', line 17 def expected @expected end |
#path ⇒ Object (readonly)
: String
16 17 18 |
# File 'lib/ibex/runtime/cst/validator.rb', line 16 def path @path end |