summaryrefslogtreecommitdiff
path: root/lib/net/protocol.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r--lib/net/protocol.rb33
1 files changed, 32 insertions, 1 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 18d82ddca0..1b6c35420c 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -153,10 +153,13 @@ Object
@socket = nil
end
-
attr_reader :address, :port,
:command, :socket
+ def inspect
+ "#<#{type} #{address}:#{port} open=#{active?}>"
+ end
+
def start( *args )
return false if active?
@@ -231,6 +234,10 @@ Object
attr_accessor :socket
attr_reader :last_reply
+ def inspect
+ "#<#{type}>"
+ end
+
# abstract quit
@@ -295,6 +302,10 @@ Object
attr_reader :code_type, :code, :message
alias msg message
+ def inspect
+ "#<#{type} #{code}>"
+ end
+
def error!( data = nil )
raise code_type.error_type.new( code + ' ' + Net.quote(msg), data )
end
@@ -320,6 +331,10 @@ Object
end
attr :data
+
+ def inspect
+ "#<#{type}>"
+ end
end
@@ -335,6 +350,10 @@ Object
attr_reader :parents
+ def inspect
+ "#<#{type}>"
+ end
+
def error_type
@err
end
@@ -370,6 +389,10 @@ Object
@mid = mid
end
+ def inspect
+ "#<#{type}>"
+ end
+
def write( str )
@sock.__send__ @mid, str
end
@@ -383,6 +406,10 @@ Object
@block = block
end
+ def inspect
+ "#<#{type}>"
+ end
+
def <<( str )
@block.call str
end
@@ -414,6 +441,10 @@ Object
alias open new
end
+ def inspect
+ "#<#{type} open=#{!@closed}>"
+ end
+
def reopen
unless closed? then
@socket.close