lib/mongoid-encrypted-fields/fields/encrypted_hash.rb
# Takes an object representation (Hash or string) and converts it to an
# EncryptedHash.
Takes an object representation (Hash or string) and converts it to an
EncryptedHash.
Takes an object representation ( Hash or string ) and converts it to an EncryptedHash .
def convert(object)
        case object
          when Hash
            from_hash(object)
          else
            from_hash(::YAML.load(object))
        end
      end
def convert ( object ) case object when Hash from_hash ( object ) else from_hash ( :: YAML . load ( object ) ) end end
Takes an object representation (Hash or string) and converts it to an
EncryptedHash.
Takes an object representation ( Hash or string ) and converts it to an EncryptedHash .
object