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
Returns the full identifier string with correct check digit.
-
#restore!(id_without_check_digit) ⇒ self
Restores (calculates) the check digit and returns the instance.
Instance Method Details
#check_digit(id) ⇒ Integer
Returns the calculated check digit.
88 89 90 |
# File 'lib/sec_id/concerns/checkable.rb', line 88 def check_digit(id) new(id).calculate_check_digit end |
#restore(id_without_check_digit) ⇒ String
Returns the full identifier string with correct check digit.
72 73 74 |
# File 'lib/sec_id/concerns/checkable.rb', line 72 def restore(id_without_check_digit) new(id_without_check_digit).restore end |
#restore!(id_without_check_digit) ⇒ self
Restores (calculates) the check digit and returns the instance.
81 82 83 |
# File 'lib/sec_id/concerns/checkable.rb', line 81 def restore!(id_without_check_digit) new(id_without_check_digit).restore! end |