lib/mongo/client.rb
# Updates this client's options from new_options, validating all options.
#
# The new options may be transformed according to various rules.
# The final hash of options actually applied to the client is returned.
#
# If options fail validation, this method may warn or raise an exception.
# If this method raises an exception, the client should be discarded
# (similarly to if a constructor raised an exception).
#
# @param [ Hash ] new_options The new options to use.
#
# @return [ Hash ] Modified new options written into the client.
#
# @api private
Updates this client's options from new_options, validating all options.
The new options may be transformed according to various rules.
The final hash of options actually applied to the client is returned.

If options fail validation, this method may warn or raise an exception.
If this method raises an exception, the client should be discarded
(similarly to if a constructor raised an exception).
Updates this client ' s options from new_options validating all options . The new options may be transformed according to various rules . The final hash of options actually applied to the client is returned . If options fail validation this method may warn or raise an exception . If this method raises an exception the client should be discarded ( similarly to if a constructor raised an exception ) .
def update_options(new_options)
      validate_new_options!(new_options).tap do |opts|
        options = @options.dup
        if options[:write] && opts[:write_concern]
          options.delete(:write)
        end
        if options[:write_concern] && opts[:write]
          options.delete(:write_concern)
        end
        options.update(opts)
        @options = options.freeze
        validate_options!
        validate_authentication_options!
      end
    end
def update_options ( new_options ) validate_new_options! ( new_options ) . tap do | opts | options = @options . dup if options [ :write ] && opts [ :write_concern ] options . delete ( :write ) end if options [ :write_concern ] && opts [ :write ] options . delete ( :write_concern ) end options . update ( opts ) @options = options . freeze validate_options! validate_authentication_options! end end
Updates this client's options from new_options, validating all options.
Updates this client ' s options from new_options validating all options .
# Our options are frozen
Modified new options written into the client.
Modified new options written into the client .
 Hash 
new_options
new_options The new options to use.
new_options The new options to use .
api
None