RUBY-322 nicer inspect methods
This commit is contained in:
parent
a916d3c8a2
commit
e2178b0f1d
|
@ -147,6 +147,11 @@ module Mongo
|
|||
setup(opts)
|
||||
end
|
||||
|
||||
def inspect
|
||||
"<Mongo::ReplSetConnection:0x#{self.object_id.to_s(16)} @seeds=#{@seeds} " +
|
||||
"@connected=#{@connected}>"
|
||||
end
|
||||
|
||||
# Initiate a connection to the replica set.
|
||||
def connect
|
||||
sync_synchronize(:EX) do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
module Mongo
|
||||
class Node
|
||||
|
||||
attr_accessor :host, :port, :address, :config, :repl_set_status, :connection, :socket
|
||||
attr_accessor :host, :port, :address, :config, :connection, :socket
|
||||
|
||||
def initialize(connection, data)
|
||||
self.connection = connection
|
||||
|
@ -21,7 +21,11 @@ module Mongo
|
|||
alias :== :eql?
|
||||
|
||||
def host_string
|
||||
"#{@host}:#{@port}"
|
||||
address
|
||||
end
|
||||
|
||||
def inspect
|
||||
"<Mongo::Node:0x#{self.object_id.to_s(16)} @host=#{@host} @port=#{@port}>"
|
||||
end
|
||||
|
||||
# Create a connection to the provided node,
|
||||
|
|
|
@ -11,6 +11,10 @@ module Mongo
|
|||
@refresh_node = nil
|
||||
end
|
||||
|
||||
def inspect
|
||||
"<Mongo::PoolManager:0x#{self.object_id.to_s(16)} @seeds=#{@seeds}>"
|
||||
end
|
||||
|
||||
def connect
|
||||
initialize_data
|
||||
members = connect_to_members
|
||||
|
|
Loading…
Reference in New Issue