Module: Cryptonite::ClassMethods
- Includes:
- KeyExtractor
- Defined in:
- lib/cryptonite.rb
Instance Method Summary collapse
-
#attr_encrypted(*attributes) ⇒ Object
Attributes listed as encrypted will be transparently encrypted and decrypted in database operations.
-
#encrypted_attributes ⇒ Object
Returns an array of all the attributes that have been specified as encrypted.
Instance Method Details
#attr_encrypted(*attributes) ⇒ Object
Attributes listed as encrypted will be transparently encrypted and decrypted in database operations.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/cryptonite.rb', line 25 def attr_encrypted(*attributes) = attributes. public_key = extract_public_key() private_key = extract_private_key() serialize_attributes_with_coder(attributes, private_key || public_key) self._attr_encrypted = Set.new(attributes.map(&:to_s)) + (_attr_encrypted || []) end |
#encrypted_attributes ⇒ Object
Returns an array of all the attributes that have been specified as encrypted.
37 38 39 |
# File 'lib/cryptonite.rb', line 37 def encrypted_attributes _attr_encrypted end |