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

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(code:, path:, message:, expected: nil, actual: nil) ⇒ ValidationError

Returns a new instance of ValidationError.

RBS:

  • (code: Symbol, path: String, message: String, ?expected: untyped, ?actual: untyped) -> void

Parameters:

  • code: (Symbol)
  • path: (String)
  • message: (String)
  • expected: (Object) (defaults to: nil)
  • actual: (Object) (defaults to: nil)


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)

Signature:

  • untyped

Returns:

  • (Object)


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

def actual
  @actual
end

#codeSymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


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

def code
  @code
end

#expectedObject (readonly)

Signature:

  • untyped

Returns:

  • (Object)


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

def expected
  @expected
end

#pathString (readonly)

Signature:

  • String

Returns:

  • (String)


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

def path
  @path
end