Method: Mongoid::Config::Introspection#options
- Defined in:
- lib/mongoid/config/introspection.rb
#options(include_deprecated: false) ⇒ Array<Introspection::Option>
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.
Extracts the available configuration options from the Mongoid::Config source file, and returns them as an array of hashes.
142 143 144 145 146 147 148 |
# File 'lib/mongoid/config/introspection.rb', line 142 def (include_deprecated: false) src = File.read(CONFIG_RB_PATH) src.scan(OPTION_PATTERN) .map { |opt| Option.from_captures(opt) } .reject { |opt| !include_deprecated && opt.deprecated? } .sort_by { |opt| opt.name } end |