Class: Llmemory::Crypto::NullCipher

Inherits:
Object
  • Object
show all
Defined in:
lib/llmemory/crypto/cipher.rb

Overview

No-op cipher when encryption is disabled or no key is configured.

Instance Method Summary collapse

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

Returns:

  • (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

Returns:

  • (Boolean)


36
37
38
# File 'lib/llmemory/crypto/cipher.rb', line 36

def encrypted?(str)
  false
end