class JsonSchema::ValidationError

Attributes

data[RW]
path[RW]
sub_errors[RW]

Public Class Methods

new(schema, path, message, type, options = {}) click to toggle source
Calls superclass method JsonSchema::SchemaError::new
# File lib/json_schema/error.rb, line 42
def initialize(schema, path, message, type, options = {})
  super(schema, message, type)
  @path = path

  # TODO: change to named optional arguments when Ruby 1.9 support is
  # removed
  @data = options[:data]
  @sub_errors = options[:sub_errors]
end

Public Instance Methods

pointer() click to toggle source
# File lib/json_schema/error.rb, line 52
def pointer
  path.join("/")
end
to_s() click to toggle source
# File lib/json_schema/error.rb, line 56
def to_s
  "#{pointer}: failed schema #{schema.pointer}: #{message}"
end