Module: Cryptonite::ClassMethods

Defined in:
lib/cryptonite.rb

Instance Method Summary collapse

Instance Method Details

#attr_encrypted(*attributes) ⇒ Object

Attributes listed as encrypted will be transparently encrypted and decrypted in database operations.



26
27
28
# File 'lib/cryptonite.rb', line 26

def attr_encrypted(*attributes)
  self._attr_encrypted = Set.new(attributes.map { |a| a.to_s }) + (self._attr_encrypted || [])
end

#encrypted_attributesObject

Returns an array of all the attributes that have been specified as encrypted.



31
32
33
# File 'lib/cryptonite.rb', line 31

def encrypted_attributes
  self._attr_encrypted
end