module EncryptAttributes::Adapters::Base

Public Instance Methods

read_encrypted_attribute(attr_name) click to toggle source
# File lib/encrypt_attributes/adapters/base.rb, line 4
def read_encrypted_attribute(attr_name)
  encryptor.decrypt(read_attribute(attr_name))
end
write_encrypted_attribute(attr_name, attr_value) click to toggle source
# File lib/encrypt_attributes/adapters/base.rb, line 8
def write_encrypted_attribute(attr_name, attr_value)
  write_attribute(attr_name, encryptor.encrypt(attr_value))
end

Private Instance Methods

encryptor() click to toggle source
# File lib/encrypt_attributes/adapters/base.rb, line 14
def encryptor
  Encryptor.new
end