Class: Mod11
Instance Method Summary collapse
- #check_digit ⇒ Object
-
#initialize(number, options = {}) ⇒ Mod11
constructor
A new instance of Mod11.
Methods inherited from LuhnBase
Constructor Details
#initialize(number, options = {}) ⇒ Mod11
Returns a new instance of Mod11.
2 3 4 5 |
# File 'lib/brid/algorithms/mod11.rb', line 2 def initialize number, = {} [:mod] = 11 super number, {:base => 2..11}.merge() end |
Instance Method Details
#check_digit ⇒ Object
7 8 9 |
# File 'lib/brid/algorithms/mod11.rb', line 7 def check_digit ((10 * sum) % @mod) % 10 end |