summaryrefslogtreecommitdiff
path: root/lib/net/protocol.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:37:38 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-09-12 05:37:38 +0000
commitfbcc6dea0c86e7e4d087f1d4b2de19b211d16647 (patch)
tree68bde87194755712893e5efa4d7f9d2f5312df10 /lib/net/protocol.rb
parent9d823983dc3e88cb7775c78908a4bb5133ad88ac (diff)
matz: 1.6.0 final (hopufully)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/protocol.rb')
-rw-r--r--lib/net/protocol.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 16d6cac..3eced45 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -46,7 +46,7 @@ Object
'*args' are specified in subclasses.
- When is called as iterator, gives Protocol object to block and
+ When is called with a block, gives Protocol object to block and
close session when block finished.
: finish
@@ -73,7 +73,7 @@ module Net
def start( address = 'localhost', port = nil, *args )
instance = new( address, port )
- if iterator? then
+ if block_given? then
instance.start( *args ) { yield instance }
else
instance.start( *args )
@@ -167,9 +167,9 @@ module Net
connect
do_start( *args )
@active = true
- yield self if iterator?
+ yield self if block_given?
ensure
- finish if iterator?
+ finish if block_given?
end
end
@@ -561,7 +561,7 @@ module Net
while (str = readuntil( "\r\n" )) != ".\r\n" do
str.chop!
arr.push str
- yield str if iterator?
+ yield str if block_given?
end
@pipe << "read #{arr.size} lines\n" if pipeon