Module: ResponseEncryption::EncryptAttributes::ClassMethods
- Defined in:
- lib/response_encryption/encrypt_attributes.rb
Instance Attribute Summary collapse
-
#encrypted_attrs(*attributes) ⇒ Object
Returns the value of attribute encrypted_attrs.
Instance Method Summary collapse
Instance Attribute Details
#encrypted_attrs(*attributes) ⇒ Object
Returns the value of attribute encrypted_attrs.
39 40 41 |
# File 'lib/response_encryption/encrypt_attributes.rb', line 39 def encrypted_attrs @encrypted_attrs end |
Instance Method Details
#encrypt_attributes!(model) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/response_encryption/encrypt_attributes.rb', line 44 def encrypt_attributes!(model) @encrypted_attrs.each do |column_name| if model.respond_to? column_name define_method(column_name) do @encrypter.encrypt(model.__send__(column_name).try(:to_s)) end else # TODO: get methods form Serializer end end end |