Exception: Rng::SchemaValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Rng::SchemaValidationError
- Defined in:
- lib/rng/schema_validator.rb
Overview
Raised when a schema violates RELAX NG structural rules
Instance Attribute Summary collapse
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#xpath ⇒ Object
readonly
Returns the value of attribute xpath.
Instance Method Summary collapse
-
#initialize(message, xpath: nil, line: nil) ⇒ SchemaValidationError
constructor
A new instance of SchemaValidationError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, xpath: nil, line: nil) ⇒ SchemaValidationError
Returns a new instance of SchemaValidationError.
11 12 13 14 15 |
# File 'lib/rng/schema_validator.rb', line 11 def initialize(, xpath: nil, line: nil) super() @xpath = xpath @line = line end |
Instance Attribute Details
#line ⇒ Object (readonly)
Returns the value of attribute line.
9 10 11 |
# File 'lib/rng/schema_validator.rb', line 9 def line @line end |
#xpath ⇒ Object (readonly)
Returns the value of attribute xpath.
9 10 11 |
# File 'lib/rng/schema_validator.rb', line 9 def xpath @xpath end |
Instance Method Details
#to_s ⇒ Object
17 18 19 20 21 |
# File 'lib/rng/schema_validator.rb', line 17 def to_s location = [@xpath, @line].compact.join(':') base = super location.empty? ? base : "#{location}: #{base}" end |