Class: DefraRuby::Validators::PostcodeValidator

Inherits:
BaseValidator
  • Object
show all
Includes:
CanValidatePresence
Defined in:
lib/defra_ruby/validators/postcode_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



10
11
12
13
14
# File 'lib/defra_ruby/validators/postcode_validator.rb', line 10

def validate_each(record, attribute, value)
  return false unless value_is_present?(record, attribute, value)

  valid_format?(record, attribute, value)
end