Sha256: 832904a070aa11f991d94957f7cbb0e349a3940ff919b25414c9fcf68a84cd30

Contents?: true

Size: 696 Bytes

Versions: 1

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

require "mongo/config/options"
require "mongo/config/validators/option"

module Mongo

  # This module defines configuration options for Mongo.
  #
  # @api private
  module Config
    extend Forwardable
    extend Options
    extend self

    option :validate_update_replace, default: false

    # Set the configuration options.
    #
    # @example Set the options.
    #   config.options = { validate_update_replace: true }
    #
    # @param [ Hash ] options The configuration options.
    def options=(options)
      options.each_pair do |option, value|
        Validators::Option.validate(option)
        send("#{option}=", value)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongo-2.18.0.beta1 lib/mongo/config.rb