diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 16:42:46 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-12 16:42:46 +0000 |
commit | 9f32fd3e9a0566e9258dda883e3ecf6f5474096d (patch) | |
tree | 3594690de77e31bad8bd108ea699117f3b7e9ddc /lib/net/protocol.rb | |
parent | b0ed08600a71784085b9b4621a4c4fcdbe0ae1cd (diff) | |
download | ruby-9f32fd3e9a0566e9258dda883e3ecf6f5474096d.tar.gz |
o protocol.rb, smtp.rb, pop.rb, http.rb: define all#inspect()
o protocol.rb, smtp.rb, pop.rb, http.rb: modify/add documents
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r-- | lib/net/protocol.rb | 33 |
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 |