Class: BraDocumentValidation::CPFValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- BraDocumentValidation::CPFValidator
- Defined in:
- lib/bra_document_validation/cpf_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 9 |
# File 'lib/bra_document_validation/cpf_validator.rb', line 5 def validate_each(record, attribute, value) return record.errors.add(attribute, (:invalid_format)) unless valid_format?(value) record.errors.add(attribute, (:invalid_verification_digit)) unless valid_verification_digit?(value) end |