Class: Valvat::Checksum::RO
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
check_digit_length, #initialize, #validate
Constructor Details
This class inherits a constructor from Valvat::Checksum::Base
Instance Method Details
#check_digit ⇒ Object
6 7 8 9 10 11 |
# File 'lib/valvat/checksum/ro.rb', line 6 def check_digit multipliers = [2, 3, 5, 7, 1, 2, 3, 5, 7] sum = sum_figures_by { |digit, index| digit * multipliers[index] } sum * 10 % 11 % 10 end |
#figures_str ⇒ Object
13 14 15 |
# File 'lib/valvat/checksum/ro.rb', line 13 def figures_str super.rjust(9, '0') end |