Module: Mongoid::Config::Validators::Option

Extended by:
Option
Included in:
Option
Defined in:
build/mongoid-master/lib/mongoid/config/validators/option.rb

Overview

Validator for configuration options.

Instance Method Summary collapse

Instance Method Details

#validate(option) ⇒ Object

Validate a configuration option.

Examples:

Validate a configuration option.

Parameters:

  • option (String)

    The name of the option.

Since:

  • 3.0.0



19
20
21
22
23
# File 'build/mongoid-master/lib/mongoid/config/validators/option.rb', line 19

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