Class: Mongoid::EncryptedTime

Inherits:
Time
  • Object
show all
Includes:
EncryptedField
Defined in:
lib/mongoid-encrypted-fields/fields/encrypted_time.rb

Class Method Summary collapse

Methods included from EncryptedField

#encrypted, #mongoize, #raw_value

Class Method Details

.convert(object) ⇒ Object



27
28
29
# File 'lib/mongoid-encrypted-fields/fields/encrypted_time.rb', line 27

def convert(object)
  from_time(object.to_time)
end

.from_time(time) ⇒ Object



23
24
25
# File 'lib/mongoid-encrypted-fields/fields/encrypted_time.rb', line 23

def from_time(time)
  parse(time.to_s)
end