module Mongo::Crypt

Public Class Methods

reset_autoload() click to toggle source

@api private

# File lib/mongo/crypt/binding.rb, line 48
def reset_autoload
  remove_const(:Binding)
  autoload(:Binding, 'mongo/crypt/binding')
end
validate_ffi!() click to toggle source
# File lib/mongo/crypt.rb, line 39
def validate_ffi!
  return if defined?(FFI)

  require 'ffi'
rescue LoadError => e
  raise Error::UnmetDependency, 'Cannot enable encryption because the ffi gem ' \
                                "has not been installed. Add \"gem 'ffi'\" to your Gemfile and run " \
                                "\"bundle install\" to install the gem. (#{e.class}: #{e})"
end

Private Instance Methods

reset_autoload() click to toggle source

@api private

# File lib/mongo/crypt/binding.rb, line 48
def reset_autoload
  remove_const(:Binding)
  autoload(:Binding, 'mongo/crypt/binding')
end
validate_ffi!() click to toggle source
# File lib/mongo/crypt.rb, line 39
def validate_ffi!
  return if defined?(FFI)

  require 'ffi'
rescue LoadError => e
  raise Error::UnmetDependency, 'Cannot enable encryption because the ffi gem ' \
                                "has not been installed. Add \"gem 'ffi'\" to your Gemfile and run " \
                                "\"bundle install\" to install the gem. (#{e.class}: #{e})"
end