Class: JSON::Schema::Attribute

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

Class Method Summary collapse

Class Method Details

.build_fragment(fragments) ⇒ Object



55
56
57
# File 'lib/json-schema/validator.rb', line 55

def self.build_fragment(fragments)
  "#/#{fragments.join('/')}"
end

.last_fragment_as_symbol(fragments) ⇒ Object



59
60
61
62
# File 'lib/json-schema/validator.rb', line 59

def self.last_fragment_as_symbol(fragments)
  return nil if fragments.empty?
  fragments.first.to_sym
end

.validate(current_schema, data, fragments, processor, validator, options = {}) ⇒ Object



52
53
# File 'lib/json-schema/validator.rb', line 52

def self.validate(current_schema, data, fragments, processor, validator, options = {})
end

.validation_error(processor, message, fragments, current_schema, failed_attribute, record_errors, error_details = {}) ⇒ Object



64
65
66
67
68
69
70
71
# File 'lib/json-schema/validator.rb', line 64

def self.validation_error(processor, message, fragments, current_schema, failed_attribute, record_errors, error_details={})
  error = ValidationError.new(message, fragments, failed_attribute, current_schema, error_details)
  if record_errors
    processor.validation_error(error)
  else
    raise error
  end
end

.validation_errors(validator) ⇒ Object



73
74
75
# File 'lib/json-schema/validator.rb', line 73

def self.validation_errors(validator)
  validator.validation_errors
end