class Mongo::Crypt::AutoEncryptionContext

A Context object initialized for auto encryption

@api private

Public Class Methods

new(mongocrypt, io, db_name, command) click to toggle source

Create a new AutoEncryptionContext object

@param [ Mongo::Crypt::Handle ] mongocrypt a Handle that

wraps a mongocrypt_t object used to create a new mongocrypt_ctx_t

@param [ ClientEncryption::IO ] io A instance of the IO class

that implements driver I/O methods required to run the
state machine

@param [ String ] db_name The name of the database against which

the command is being made

@param [ Hash ] command The command to be encrypted

Calls superclass method
# File lib/mongo/crypt/auto_encryption_context.rb, line 36
def initialize(mongocrypt, io, db_name, command)
  super(mongocrypt, io)

  @db_name = db_name
  @command = command

  # Initialize the ctx object for auto encryption
  Binding.ctx_encrypt_init(self, @db_name, @command)
end