Class: VatNumberValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- VatNumberValidator
- Includes:
- HTTParty
- Defined in:
- lib/vat_number_validator.rb,
lib/vat_number_validator/errors.rb,
lib/vat_number_validator/configuration.rb
Defined Under Namespace
Classes: APIError, Configuration
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
11 12 13 14 15 |
# File 'lib/vat_number_validator.rb', line 11 def validate_each(record, attribute, value) unless valid?(value) record.errors.add(attribute, :incorrect_vat_number_format) end end |