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.



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

Instance Attribute Details

#actualObject (readonly)

: untyped



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

def actual
  @actual
end

#codeObject (readonly)

: Symbol



11
12
13
# File 'lib/ibex/runtime/cst/validator.rb', line 11

def code
  @code
end

#expectedObject (readonly)

: untyped



13
14
15
# File 'lib/ibex/runtime/cst/validator.rb', line 13

def expected
  @expected
end

#pathObject (readonly)

: String



12
13
14
# File 'lib/ibex/runtime/cst/validator.rb', line 12

def path
  @path
end