Class: JsonSchema::ValidationError
- Inherits:
-
SchemaError
- Object
- SchemaError
- JsonSchema::ValidationError
- Defined in:
- lib/json_schema/schema_error.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#sub_errors ⇒ Object
Returns the value of attribute sub_errors.
Attributes inherited from SchemaError
Instance Method Summary collapse
-
#initialize(schema, path, message, type, sub_errors = nil) ⇒ ValidationError
constructor
A new instance of ValidationError.
- #pointer ⇒ Object
- #to_s ⇒ Object
Methods inherited from SchemaError
Constructor Details
#initialize(schema, path, message, type, sub_errors = nil) ⇒ ValidationError
Returns a new instance of ValidationError.
23 24 25 26 27 |
# File 'lib/json_schema/schema_error.rb', line 23 def initialize(schema, path, , type, sub_errors = nil) super(schema, , type) @path = path @sub_errors = sub_errors end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
21 22 23 |
# File 'lib/json_schema/schema_error.rb', line 21 def path @path end |
#sub_errors ⇒ Object
Returns the value of attribute sub_errors.
21 22 23 |
# File 'lib/json_schema/schema_error.rb', line 21 def sub_errors @sub_errors end |
Instance Method Details
#pointer ⇒ Object
29 30 31 |
# File 'lib/json_schema/schema_error.rb', line 29 def pointer path.join("/") end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/json_schema/schema_error.rb', line 33 def to_s "#{pointer}: failed schema #{schema.pointer}: #{}" end |