lib/mongo/uri.rb
# Gets the options hash that needs to be passed to a Mongo::Client on
# instantiation, so we don't have to merge the credentials and database in
# at that point - we only have a single point here.
#
# @example Get the client options.
#   uri.client_options
#
# @return [ Mongo::Options::Redacted ] The options passed to the Mongo::Client
#
# @since 2.0.0
Gets the options hash that needs to be passed to a Mongo::Client on
instantiation, so we don't have to merge the credentials and database in
at that point - we only have a single point here.
Gets the options hash that needs to be passed to a Mongo :: Client on instantiation so we don ' t have to merge the credentials and database in at that point - we only have a single point here .
def client_options
      opts = uri_options.tap do |opts|
        opts[:database] = @database if @database
      end
      @user ? opts.merge(credentials) : opts
    end
def client_options opts = uri_options . tap do | opts | opts [ :database ] = @database if @database end @user ? opts . merge ( credentials ) : opts end
Gets the options hash that needs to be passed to a Mongo::Client on
instantiation, so we don't have to merge the credentials and database in
at that point - we only have a single point here.
Gets the options hash that needs to be passed to a Mongo :: Client on instantiation so we don ' t have to merge the credentials and database in at that point - we only have a single point here .
The options passed to the Mongo::Client
The options passed to the Mongo :: Client
 Mongo::Options::Redacted 
example
Get the client options. uri.client_options
Get the client options . uri . client_options
since
None