Class: LicenseValidator::Validations::StateNe

Inherits:
Base
  • Object
show all
Defined in:
lib/license_validator/validations/state_ne.rb

Instance Attribute Summary

Attributes inherited from Base

#driver, #errors, #infos, #warnings

Instance Method Summary collapse

Methods inherited from Base

human_attribute_name, #initialize, lookup_ancestors, #read_attribute_for_validation, #validation_results

Constructor Details

This class inherits a constructor from LicenseValidator::Validations::Base

Instance Method Details

#validateObject

See Also:

  • super


7
8
9
10
11
12
13
# File 'lib/license_validator/validations/state_ne.rb', line 7

def validate
  super

  return if driver.license_num.match?(/\A[abceghprvz]\d{1,8}\z/i)

  errors.add(:license_num, 'License number requires 1 alphabetic (A,B,C,E,G,H,P,R,V or Z), 1-8 numeric for NE.')
end