Module: CardValidator::Validator::LuhnAlg

Defined in:
lib/card_validator/validator/luhn_alg.rb

Class Method Summary collapse

Class Method Details

.valid?(card) ⇒ Boolean

Returns:

  • (Boolean)

7
8
9
# File 'lib/card_validator/validator/luhn_alg.rb', line 7

def valid?(card)
  sum_of_doubles(card) % 10 == 0
end