class Exception4
Perform the standard modulus 11 check. After you have finished the check, ensure that the remainder is the same as the two-digit checkdigit; the checkdigit for exception 4 is gh from the original account number.
Public Instance Methods
override_test?()
click to toggle source
# File lib/uk_account_validator/exceptions/exception_4.rb, line 6 def override_test? true end
test(modulus, total, test_digits, _test)
click to toggle source
# File lib/uk_account_validator/exceptions/exception_4.rb, line 10 def test(modulus, total, test_digits, _test) check_sum = [test_digits[NUMBER_INDEX[:g]], test_digits[NUMBER_INDEX[:h]]].join check_sum = check_sum.to_i total % modulus == check_sum end