Class: Llmemory::Crypto::NullCipher
- Inherits:
-
Object
- Object
- Llmemory::Crypto::NullCipher
- Defined in:
- lib/llmemory/crypto/cipher.rb
Overview
No-op cipher when encryption is disabled or no key is configured.
Instance Method Summary collapse
- #decrypt(str) ⇒ Object
- #decrypt_json(str) ⇒ Object
- #enabled? ⇒ Boolean
- #encrypt(str) ⇒ Object
- #encrypt_deterministic(str) ⇒ Object
- #encrypt_json(obj) ⇒ Object
- #encrypted?(str) ⇒ Boolean
Instance Method Details
#decrypt(str) ⇒ Object
24 25 26 |
# File 'lib/llmemory/crypto/cipher.rb', line 24 def decrypt(str) str.to_s end |
#decrypt_json(str) ⇒ Object
32 33 34 |
# File 'lib/llmemory/crypto/cipher.rb', line 32 def decrypt_json(str) JSON.parse(str.to_s, symbolize_names: true) end |
#enabled? ⇒ Boolean
12 13 14 |
# File 'lib/llmemory/crypto/cipher.rb', line 12 def enabled? false end |
#encrypt(str) ⇒ Object
16 17 18 |
# File 'lib/llmemory/crypto/cipher.rb', line 16 def encrypt(str) str.to_s end |
#encrypt_deterministic(str) ⇒ Object
20 21 22 |
# File 'lib/llmemory/crypto/cipher.rb', line 20 def encrypt_deterministic(str) str.to_s end |
#encrypt_json(obj) ⇒ Object
28 29 30 |
# File 'lib/llmemory/crypto/cipher.rb', line 28 def encrypt_json(obj) JSON.generate(obj) end |
#encrypted?(str) ⇒ Boolean
36 37 38 |
# File 'lib/llmemory/crypto/cipher.rb', line 36 def encrypted?(str) false end |