summaryrefslogtreecommitdiffstats
path: root/lib/net/pop.rb
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-24 19:39:15 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-24 19:39:15 +0000
commitef5f2bcb3fb415c08893513c603b56bb3dee1f1a (patch)
tree599f4edb425f5bdbfb6dc11fcf5c69ab0ac699c0 /lib/net/pop.rb
parent990208c8796824bdbe43445e3e7e20554ff97b35 (diff)
downloadruby-ef5f2bcb3fb415c08893513c603b56bb3dee1f1a.tar.gz
ruby-ef5f2bcb3fb415c08893513c603b56bb3dee1f1a.tar.xz
ruby-ef5f2bcb3fb415c08893513c603b56bb3dee1f1a.zip
aamine
* lib/net/http.rb: does not send HEAD on closing socket. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/pop.rb')
-rw-r--r--lib/net/pop.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/net/pop.rb b/lib/net/pop.rb
index 4f6eb930a..130e7a987 100644
--- a/lib/net/pop.rb
+++ b/lib/net/pop.rb
@@ -1,6 +1,6 @@
=begin
-= net/pop.rb version 1.1.32
+= net/pop.rb version 1.2.0
written by Minero Aoki <aamine@dp.u-netsurf.ne.jp>
@@ -126,14 +126,16 @@ Object
=== Methods
-: pop( dest = '' )
+: all( dest = '' )
+: pop
+: mail
This method fetches a mail and write to 'dest' using '<<' method.
# usage example
mailarr = []
POP3.start( 'localhost', 110 ) do |pop|
- pop.each_mail do |popm|
+ pop.each do |popm|
mailarr.push popm.pop # all() returns 'dest' (this time, string)
# or, you can also
# popm.pop( $stdout ) # write mail to stdout
@@ -143,16 +145,15 @@ Object
end
end
-: pop {|str| .... }
- If pop() is called with block, it gives the block part strings of a mail.
+: all {|str| .... }
+ You can call all/pop/mail with block.
+ argument 'str' is a read string (a part of mail).
# usage example
- POP3.start( 'localhost', 110 ) do |pop3|
- pop3.each_mail do |m|
- m.pop do |str|
- # do anything
- end
+ POP3.start( 'localhost', 110 ) do |pop|
+ pop.mails[0].pop do |str| # pop only first mail...
+ _do_anything_( str )
end
end