Sha256: 42ff657b8e01579c6a52483389cf41de053993b4db5d67dbfdf16ec2b58ddebf

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

# frozen_string_literal: true

module Mongo
  module Config
    module Validators

      # Validator for configuration options.
      #
      # @api private
      module Option
        extend self

        # Validate a configuration option.
        #
        # @example Validate a configuration option.
        #
        # @param [ String ] option The name of the option.
        def validate(option)
          unless Config.settings.keys.include?(option.to_sym)
            raise Mongo::Error::InvalidConfigOption.new(option)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mongo-2.18.3 lib/mongo/config/validators/option.rb
mongo-2.18.2 lib/mongo/config/validators/option.rb
mongo-2.18.1 lib/mongo/config/validators/option.rb
mongo-2.18.0 lib/mongo/config/validators/option.rb
mongo-2.18.0.beta1 lib/mongo/config/validators/option.rb