Module: SecID::Checkable::ClassMethods
- Defined in:
- lib/sec_id/concerns/checkable.rb
Overview
Class methods added when Checkable is included.
Instance Method Summary collapse
-
#checksum(id) ⇒ Integer, String
The calculated checksum.
-
#restore(id_without_checksum) ⇒ String
Returns the full identifier string with correct checksum.
-
#restore!(id_without_checksum) ⇒ self
Restores (calculates) the checksum and returns the instance.
Instance Method Details
#checksum(id) ⇒ Integer, String
Returns the calculated checksum.
87 88 89 |
# File 'lib/sec_id/concerns/checkable.rb', line 87 def checksum(id) new(id).calculate_checksum end |
#restore(id_without_checksum) ⇒ String
Returns the full identifier string with correct checksum.
71 72 73 |
# File 'lib/sec_id/concerns/checkable.rb', line 71 def restore(id_without_checksum) new(id_without_checksum).restore end |
#restore!(id_without_checksum) ⇒ self
Restores (calculates) the checksum and returns the instance.
80 81 82 |
# File 'lib/sec_id/concerns/checkable.rb', line 80 def restore!(id_without_checksum) new(id_without_checksum).restore! end |