Exception: ShEx::NotSatisfied

Inherits:
Error
  • Object
show all
Defined in:
lib/shex.rb

Overview

Shape expectation not satisfied

Instance Attribute Summary collapse

Attributes inherited from Error

#code

Instance Method Summary collapse

Constructor Details

#initialize(message, expression: self) ⇒ NotSatisfied

Initializes a new parser error instance.

Parameters:



141
142
143
144
# File 'lib/shex.rb', line 141

def initialize(message, expression: self)
  @expression = expression
  super(message.to_s)
end

Instance Attribute Details

#expressionShEx::Algebra::ShapeExpression (readonly)

The expression which was not satified



134
135
136
# File 'lib/shex.rb', line 134

def expression
  @expression
end

Instance Method Details

#inspectObject



146
147
148
# File 'lib/shex.rb', line 146

def inspect
  super + (expression ? SXP::Generator.string(expression.to_sxp_bin) : '')
end