Class: JSON::Validator::ErrorRecorder

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/json-schema/validator.rb

Instance Method Summary collapse

Constructor Details

#initialize(sub) ⇒ ErrorRecorder

Returns a new instance of ErrorRecorder.



113
114
115
116
117
# File 'lib/json-schema/validator.rb', line 113

def initialize(sub)
  @errors = []

  super
end

Instance Method Details

#validation_error(error) ⇒ Object



119
120
121
# File 'lib/json-schema/validator.rb', line 119

def validation_error(error)
  @errors.push(error)
end

#validation_errorsObject



123
124
125
# File 'lib/json-schema/validator.rb', line 123

def validation_errors
  @errors
end

#with_errorsObject



127
128
129
# File 'lib/json-schema/validator.rb', line 127

def with_errors
  self
end