Exception: Ibex::Runtime::CST::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ibex/runtime/cst/validator.rb

Overview

Structured failure raised for an invalid or incompatible CST document.

Instance Attribute Summary collapse

Instance Method Summary collapse

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}: #{message}")
end

Instance Attribute Details

#actualObject (readonly)

: json_value



18
19
20
# File 'lib/ibex/runtime/cst/validator.rb', line 18

def actual
  @actual
end

#codeObject (readonly)

: Symbol



15
16
17
# File 'lib/ibex/runtime/cst/validator.rb', line 15

def code
  @code
end

#expectedObject (readonly)

: json_value



17
18
19
# File 'lib/ibex/runtime/cst/validator.rb', line 17

def expected
  @expected
end

#pathObject (readonly)

: String



16
17
18
# File 'lib/ibex/runtime/cst/validator.rb', line 16

def path
  @path
end