Exception: JsonSchema::SchemaError
- Defined in:
- lib/json_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.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(schema, message, type) ⇒ SchemaError
constructor
A new instance of SchemaError.
- #to_s ⇒ Object
Constructor Details
#initialize(schema, message, type) ⇒ SchemaError
Returns a new instance of SchemaError.
24 25 26 27 28 |
# File 'lib/json_schema/error.rb', line 24 def initialize(schema, , type) @schema = schema @message = @type = type end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
18 19 20 |
# File 'lib/json_schema/error.rb', line 18 def @message end |
#schema ⇒ Object
Returns the value of attribute schema.
18 19 20 |
# File 'lib/json_schema/error.rb', line 18 def schema @schema end |
#type ⇒ Object
Returns the value of attribute type.
18 19 20 |
# File 'lib/json_schema/error.rb', line 18 def type @type end |
Class Method Details
.aggregate(errors) ⇒ Object
20 21 22 |
# File 'lib/json_schema/error.rb', line 20 def self.aggregate(errors) errors.map(&:to_s) end |
Instance Method Details
#to_s ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/json_schema/error.rb', line 30 def to_s if schema && schema.pointer "#{schema.pointer}: #{}" else end end |