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
: untyped.
-
#code ⇒ Object
readonly
: Symbol.
-
#expected ⇒ Object
readonly
: untyped.
-
#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.
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)
: untyped
14 15 16 |
# File 'lib/ibex/runtime/cst/validator.rb', line 14 def actual @actual end |
#code ⇒ Object (readonly)
: Symbol
11 12 13 |
# File 'lib/ibex/runtime/cst/validator.rb', line 11 def code @code end |
#expected ⇒ Object (readonly)
: untyped
13 14 15 |
# File 'lib/ibex/runtime/cst/validator.rb', line 13 def expected @expected end |
#path ⇒ Object (readonly)
: String
12 13 14 |
# File 'lib/ibex/runtime/cst/validator.rb', line 12 def path @path end |