Class: JsonSchema::SchemaError
- Inherits:
-
Object
- Object
- JsonSchema::SchemaError
- Defined in:
- lib/json_schema/schema_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#schema ⇒ Object
Returns the value of attribute schema.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schema, message) ⇒ SchemaError
constructor
A new instance of SchemaError.
Constructor Details
#initialize(schema, message) ⇒ SchemaError
Returns a new instance of SchemaError.
16 17 18 19 |
# File 'lib/json_schema/schema_error.rb', line 16 def initialize(schema, ) @schema = schema = end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/json_schema/schema_error.rb', line 3 def end |
#schema ⇒ Object
Returns the value of attribute schema.
4 5 6 |
# File 'lib/json_schema/schema_error.rb', line 4 def schema @schema end |
Class Method Details
.aggregate(errors) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/json_schema/schema_error.rb', line 6 def self.aggregate(errors) errors.map { |e| if e.is_a?(ValidationError) "#{e.pointer}: failed schema #{e.schema.pointer}: #{e.message}" else "#{e.schema.pointer}: #{e.message}" end } end |