Class: PasepPisNitValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- PasepPisNitValidator
- Defined in:
- lib/pasep-pis-nit/validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
2 3 4 5 |
# File 'lib/pasep-pis-nit/validator.rb', line 2 def validate_each(record, attribute, value) return if value.nil? record.errors.add(attribute, [:message] || :invalid) unless PasepPisNit::Pis.new(value).valido? end |