Module: SecId::Checkable::ClassMethods
- Defined in:
- lib/sec_id/concerns/checkable.rb
Overview
Class methods added when Checkable is included.
Instance Method Summary collapse
-
#check_digit(id) ⇒ Integer
The calculated check digit.
-
#restore!(id_without_check_digit) ⇒ String
Restores (calculates) the check digit and returns the full identifier.
Instance Method Details
#check_digit(id) ⇒ Integer
Returns the calculated check digit.
78 79 80 |
# File 'lib/sec_id/concerns/checkable.rb', line 78 def check_digit(id) new(id).calculate_check_digit end |
#restore!(id_without_check_digit) ⇒ String
Restores (calculates) the check digit and returns the full identifier.
71 72 73 |
# File 'lib/sec_id/concerns/checkable.rb', line 71 def restore!(id_without_check_digit) new(id_without_check_digit).restore! end |