class JSchema::Validator::AllOf

Private Instance Methods

post_initialize(all_of) click to toggle source
# File lib/jschema/validator/all_of.rb, line 12
def post_initialize(all_of)
  @all_of = all_of.map.with_index do |sch, index|
    Schema.build(sch, parent, "allOf/#{index}")
  end
end
validate_args(all_of) click to toggle source
# File lib/jschema/validator/all_of.rb, line 8
def validate_args(all_of)
  schema_array?(all_of, 'allOf') || invalid_schema('allOf', all_of)
end
validate_instance(instance) click to toggle source
# File lib/jschema/validator/all_of.rb, line 18
def validate_instance(instance)
  valid = @all_of.all? do |schema|
    schema.valid?(instance)
  end

  unless valid
    "#{instance} must be valid against all the schemas"
  end
end