module Encryptor::String

Adds encrypt and decrypt methods to strings

Public Instance Methods

decrypt(options = {}) click to toggle source

Returns a new string containing the decrypted version of itself

   # File lib/encryptor/string.rb
15 def decrypt(options = {})
16   Encryptor.decrypt(options.merge(value: self))
17 end
decrypt!(options = {}) click to toggle source

Replaces the contents of a string with the decrypted version of itself

   # File lib/encryptor/string.rb
20 def decrypt!(options = {})
21   replace decrypt(options)
22 end
encrypt(options = {}) click to toggle source

Returns a new string containing the encrypted version of itself

  # File lib/encryptor/string.rb
5 def encrypt(options = {})
6   Encryptor.encrypt(options.merge(value: self))
7 end
encrypt!(options ={}) click to toggle source

Replaces the contents of a string with the encrypted version of itself

   # File lib/encryptor/string.rb
10 def encrypt!(options ={})
11   replace encrypt(options)
12 end