Module: Mongo::Config::Validators::Option Private

Extended by:
Option
Included in:
Option
Defined in:
build/ruby-driver-v2.18/lib/mongo/config/validators/option.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Validator for configuration options.

Instance Method Summary collapse

Instance Method Details

#validate(option) ⇒ Object

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.

Validate a configuration option.

Examples:

Validate a configuration option.

Parameters:

  • option (String)

    The name of the option.



18
19
20
21
22
# File 'build/ruby-driver-v2.18/lib/mongo/config/validators/option.rb', line 18

def validate(option)
  unless Config.settings.keys.include?(option.to_sym)
    raise Mongo::Error::InvalidConfigOption.new(option)
  end
end