Class: Mongo::Crypt::Handle Private
- Inherits:
-
Object
- Object
- Mongo::Crypt::Handle
- Defined in:
- lib/mongo/crypt/handle.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A handle to the libmongocrypt library that wraps a mongocrypt_t object, allowing clients to set options on that object or perform operations such as encryption and decryption
Instance Method Summary collapse
-
#initialize(kms_providers, options = {}) ⇒ Handle
constructor
private
Creates a new Handle object and initializes it with options.
-
#ref ⇒ FFI::Pointer
private
Return the reference to the underlying @mongocrypt object.
Constructor Details
#initialize(kms_providers, options = {}) ⇒ Handle
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new Handle object and initializes it with options
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/mongo/crypt/handle.rb', line 39 def initialize(kms_providers, ={}) # FFI::AutoPointer uses a custom release strategy to automatically free # the pointer once this object goes out of scope @mongocrypt = FFI::AutoPointer.new( Binding.mongocrypt_new, Binding.method(:mongocrypt_destroy) ) @schema_map = [:schema_map] set_schema_map if @schema_map @logger = [:logger] set_logger_callback if @logger set_crypto_hooks set_kms_providers(kms_providers) initialize_mongocrypt end |
Instance Method Details
#ref ⇒ FFI::Pointer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the reference to the underlying @mongocrypt object
62 63 64 |
# File 'lib/mongo/crypt/handle.rb', line 62 def ref @mongocrypt end |