Module: ActiveEncryption::Encryptable
- Defined in:
- lib/active_encryption/encryptable.rb,
lib/active_encryption/encryptable/instance_methods_on_activation.rb
Overview
The ActiveEncryption::Encryptable encapsulates methods and classes to make a model attribute encryptable.
Usage:
class MyModel
extend ActiveEncryption::Encryptable
encrypted_attr :my_attribute
end
Defined Under Namespace
Classes: InstanceMethodsOnActivation
Instance Method Summary collapse
- #encrypted_attr(attribute_name, options = {}) ⇒ Object
-
#encryption_setting ⇒ Object
:reek:UtilityFunction should be ok for ClassMethod modules?.
Instance Method Details
#encrypted_attr(attribute_name, options = {}) ⇒ Object
17 18 19 |
# File 'lib/active_encryption/encryptable.rb', line 17 def encrypted_attr(attribute_name, = {}) include InstanceMethodsOnActivation.new(attribute_name, ) end |
#encryption_setting ⇒ Object
:reek:UtilityFunction should be ok for ClassMethod modules?
22 23 24 25 26 27 |
# File 'lib/active_encryption/encryptable.rb', line 22 def encryption_setting config = ActiveEncryption.config store = config.encryption_setting_store id = config.default_encryption_setting_id store.find(id) end |