Class: Nexaas::Cipher::CrypterBase
- Inherits:
-
Object
- Object
- Nexaas::Cipher::CrypterBase
- Defined in:
- lib/nexaas/cipher/crypter_base.rb
Overview
CrypterBase: abstract class to support crypter classes
Direct Known Subclasses
Instance Attribute Summary collapse
-
#salt ⇒ Object
readonly
Returns the value of attribute salt.
Instance Method Summary collapse
- #decrypt(code, **options) ⇒ Object
- #encrypt(code, **options) ⇒ Object
-
#initialize(*args) ⇒ CrypterBase
constructor
A new instance of CrypterBase.
- #salt? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ CrypterBase
Returns a new instance of CrypterBase.
9 10 11 |
# File 'lib/nexaas/cipher/crypter_base.rb', line 9 def initialize(*args) @salt = Salt.new(*args) end |
Instance Attribute Details
#salt ⇒ Object (readonly)
Returns the value of attribute salt.
7 8 9 |
# File 'lib/nexaas/cipher/crypter_base.rb', line 7 def salt @salt end |
Instance Method Details
#decrypt(code, **options) ⇒ Object
17 18 19 |
# File 'lib/nexaas/cipher/crypter_base.rb', line 17 def decrypt(code, **) guarded_crypt(code, :do_decrypt, **) end |
#encrypt(code, **options) ⇒ Object
13 14 15 |
# File 'lib/nexaas/cipher/crypter_base.rb', line 13 def encrypt(code, **) guarded_crypt(code, :do_encrypt, **) end |
#salt? ⇒ Boolean
21 22 23 |
# File 'lib/nexaas/cipher/crypter_base.rb', line 21 def salt? salt.salt? end |