Class: JsonValidation::Validators::AllOf
- Defined in:
- lib/json_validation/validators/all_of.rb
Instance Attribute Summary
Attributes inherited from Validator
Instance Method Summary collapse
Methods inherited from Validator
#build_validator, #build_validator_with_new_base_uri, #initialize, type
Constructor Details
This class inherits a constructor from JsonValidation::Validators::Validator
Instance Method Details
#inner_validators ⇒ Object
10 11 12 13 14 |
# File 'lib/json_validation/validators/all_of.rb', line 10 def inner_validators @inner_validators ||= fragment["allOf"].map {|f| build_validator(f) } end |
#validate(record) ⇒ Object
6 7 8 |
# File 'lib/json_validation/validators/all_of.rb', line 6 def validate(record) inner_validators.all? {|validator| validator.validate(record)} end |