Skip to content

Commit

Permalink
Removed deprecated Connection methods
Browse files Browse the repository at this point in the history
  • Loading branch information
banker committed Oct 4, 2010
1 parent 8dce3a6 commit f7a97a0
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions lib/mongo/connection.rb
Expand Up @@ -168,35 +168,6 @@ def self.multi(nodes, opts={})
end
end

# @deprecated
#
# Initialize a paired connection to MongoDB.
#
# @param nodes [Array] An array of arrays, each of which specified a host and port.
# @param opts Takes the same options as Connection.new
#
# @example
# Connection.paired([["db1.example.com", 27017],
# ["db2.example.com", 27017]])
#
# @example
# Connection.paired([["db1.example.com", 27017],
# ["db2.example.com", 27017]],
# :pool_size => 20, :timeout => 5)
#
# @return [Mongo::Connection]
def self.paired(nodes, opts={})
warn "Connection.paired is deprecated. Please use Connection.multi instead."
unless nodes.length == 2 && nodes.all? {|n| n.is_a? Array}
raise MongoArgumentError, "Connection.paired requires that exactly two nodes be specified."
end
# Block returns an array, the first element being an array of nodes and the second an array
# of authorizations for the database.
new(nil, nil, opts) do |con|
[con.pair_val_to_connection(nodes[0]), con.pair_val_to_connection(nodes[1])]
end
end

# Initialize a connection to MongoDB using the MongoDB URI spec:
#
# @param uri [String]
Expand Down Expand Up @@ -508,15 +479,6 @@ def connect
raise ConnectionFailure, "failed to connect to any given host:port" unless connected?
end

# @deprecated
#
# Create a new socket and attempt to connect to master.
# If successful, sets host and port to master and returns the socket.
def connect_to_master
warn "Connection#connect_to_master is deprecated. Use Connection#connect instead."
connect
end

def connected?
@host && @port
end
Expand Down

0 comments on commit f7a97a0

Please sign in to comment.