Class: Mongoid::EncryptedString
- Inherits:
-
String
- Object
- String
- Mongoid::EncryptedString
- Defined in:
- lib/mongoid/encrypted_string.rb,
lib/mongoid/encrypted_string/version.rb
Constant Summary collapse
- VERSION =
'0.1.0'
Class Attribute Summary collapse
-
.key ⇒ Object
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.key ⇒ Object
Returns the value of attribute key.
12 13 14 |
# File 'lib/mongoid/encrypted_string.rb', line 12 def key @key end |
Class Method Details
.config ⇒ Object
24 25 26 |
# File 'lib/mongoid/encrypted_string.rb', line 24 def config self end |
.demongoize(string) ⇒ Object
18 19 20 21 22 |
# File 'lib/mongoid/encrypted_string.rb', line 18 def demongoize(string) return if string.nil? new(aes.decrypt(string)) end |
.mongoize(string) ⇒ Object
14 15 16 |
# File 'lib/mongoid/encrypted_string.rb', line 14 def mongoize(string) aes.encrypt(string) end |
Instance Method Details
#mongoize ⇒ Object
7 8 9 |
# File 'lib/mongoid/encrypted_string.rb', line 7 def mongoize self.class.mongoize(self) end |