Class: Mod10
Instance Method Summary collapse
- #check_digit ⇒ Object
-
#initialize(number, options = {}) ⇒ Mod10
constructor
A new instance of Mod10.
Methods inherited from LuhnBase
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, = {} super number, :base => [2, 1], :mod => 10 end |
Instance Method Details
#check_digit ⇒ Object
6 7 8 |
# File 'lib/brid/algorithms/mod10.rb', line 6 def check_digit 10 - (sum % 10) end |