Class: Valvat::Checksum::ES
Constant Summary collapse
- NATURAL_PERSON_CHARS =
%w[T R W A G M Y F P D X B N J Z S Q V H L C K E].freeze
- NATURAL_PERSON_EXP =
/\A[KLMXYZ\d]/.freeze
- LEGAL_PERSON_CHARS =
[false] + %w[A B C D E F G H I J]
- NIE_DIGIT_BY_LETTER =
%w[X Y Z].freeze
- GIVEN_CD_IS_A_LETTER_EXP =
/[A-Z]\Z/.freeze
- LEGAL_PERSON_EXP =
/\A[ABCDEFGHJUVNPQRSW]/.freeze
- CIF_MUST_BE_A_LETTER_EXP =
/\A[NPQRSW]/.freeze
- CIF_MUST_BE_A_NUMBER_EXP =
/\A[HJUV]/.freeze
- SPECIAL_NIF_EXP =
/\A[KLM]/.freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
check_digit_length, #initialize
Constructor Details
This class inherits a constructor from Valvat::Checksum::Base
Instance Method Details
#validate ⇒ Object
16 17 18 |
# File 'lib/valvat/checksum/es.rb', line 16 def validate passes_special_validations? && possible_check_digits.include?(given_check_digit) end |