remove old DB#command arguments

This commit is contained in:
Kyle Banker 2010-08-04 16:26:29 -04:00
parent f1f0c87b3b
commit 9e223f4510
1 changed files with 5 additions and 8 deletions

View File

@ -462,9 +462,6 @@ module Mongo
# key, specifying the command to be performed. In Ruby 1.9, OrderedHash isn't necessary since # key, specifying the command to be performed. In Ruby 1.9, OrderedHash isn't necessary since
# hashes are ordered by default. # hashes are ordered by default.
# #
# @param [Boolean] admin If +true+, the command will be executed on the admin
# collection. DEPRECATED.
#
# @option opts [Boolean] :check_response (true) If +true+, raises an exception if the # @option opts [Boolean] :check_response (true) If +true+, raises an exception if the
# command fails. # command fails.
# @option opts [Socket] :sock a socket to use for sending the command. This is mainly for internal use. # @option opts [Socket] :sock a socket to use for sending the command. This is mainly for internal use.
@ -472,8 +469,8 @@ module Mongo
# @return [Hash] # @return [Hash]
# #
# @core commands command_instance-method # @core commands command_instance-method
def command(selector, opts={}, old_check_response=false, old_sock=nil) def command(selector, opts={})
check_response = opts[:check_response].nil? ? true : opts[:check_response] check_response = opts.fetch(:check_response, true)
sock = opts[:sock] sock = opts[:sock]
raise MongoArgumentError, "command must be given a selector" unless selector.is_a?(Hash) && !selector.empty? raise MongoArgumentError, "command must be given a selector" unless selector.is_a?(Hash) && !selector.empty?
if selector.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash if selector.keys.length > 1 && RUBY_VERSION < '1.9' && selector.class != BSON::OrderedHash