Class: Mod10

Inherits:
LuhnBase show all
Defined in:
lib/brid/algorithms/mod10.rb

Instance Method Summary collapse

Methods inherited from LuhnBase

#*, #+, #==, #to_s

Constructor Details

#initialize(number, options = {}) ⇒ Mod10

Returns a new instance of Mod10.



2
3
4
# File 'lib/brid/algorithms/mod10.rb', line 2

def initialize number, options = {}
  super number, :base => [2, 1], :mod => 10
end

Instance Method Details

#check_digitObject



6
7
8
# File 'lib/brid/algorithms/mod10.rb', line 6

def check_digit
  10 - (sum % 10) 
end