Class: JsonValidation::Validators::MultipleOf
- Defined in:
- lib/json_validation/validators/multiple_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
#validate(record) ⇒ Object
6 7 8 |
# File 'lib/json_validation/validators/multiple_of.rb', line 6 def validate(record) BigDecimal.new(record.to_s) % BigDecimal.new(fragment['multipleOf'].to_s) == 0 end |