Class: Mongoid::Fields::Encrypted

Inherits:
Standard
  • Object
show all
Defined in:
lib/mongoid/fields/encrypted.rb

Instance Method Summary collapse

Instance Method Details

#demongoize(object) ⇒ Object



4
5
6
7
8
# File 'lib/mongoid/fields/encrypted.rb', line 4

def demongoize(object)
  if object
    type.demongoize(Mongoid::Encrypted::Encryptor.decrypt(object))
  end
end

#encrypted?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/mongoid/fields/encrypted.rb', line 10

def encrypted?
  true
end

#mongoize(object) ⇒ Object



14
15
16
# File 'lib/mongoid/fields/encrypted.rb', line 14

def mongoize(object)
  Mongoid::Encrypted::Encryptor.encrypt(object)
end