class Udongo::Crypt
Attributes
options[R]
Public Class Methods
new(secret: Rails.configuration.secret_key_base)
click to toggle source
# File lib/udongo/crypt.rb, line 4 def initialize(secret: Rails.configuration.secret_key_base) @options = { secret: secret } end
Public Instance Methods
crypt()
click to toggle source
# File lib/udongo/crypt.rb, line 8 def crypt @crypt ||= ActiveSupport::MessageEncryptor.new(options[:secret]) end
decrypt(value)
click to toggle source
# File lib/udongo/crypt.rb, line 16 def decrypt(value) crypt.decrypt_and_verify(value) end
encrypt(value)
click to toggle source
# File lib/udongo/crypt.rb, line 12 def encrypt(value) crypt.encrypt_and_sign(value) end