From 273a14a44cd790874e94bb7335eeea687477fe3e Mon Sep 17 00:00:00 2001 From: aamine Date: Tue, 6 May 2003 08:48:51 +0000 Subject: * lib/net/pop.rb: rename method: POP3#mail_size -> n_mails * lib/net/pop.rb: rename method: POP3#bytes -> n_bytes git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/pop.rb | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'lib/net') diff --git a/lib/net/pop.rb b/lib/net/pop.rb index 1d1373d4d6..d0c370bdb9 100644 --- a/lib/net/pop.rb +++ b/lib/net/pop.rb @@ -226,6 +226,7 @@ Normally unique-id is a hash of the message. : auth_only( address, port = 110, account, password, isapop = false ) (just for POP-before-SMTP) + opens POP3 session and does autholize and quit. This method must not be called while POP3 session is opened. This method raises POPAuthenticationError if authentication is failed. @@ -272,6 +273,12 @@ Normally unique-id is a hash of the message. finishes POP3 session. If POP3 session had not be started, raises an IOError. +: n_mails + returns the number of mails on the POP server. + +: n_bytes + returns the bytes of all mails on the POP server. + : mails an array of Net::POPMail objects. This array is renewed when session restarts. @@ -298,21 +305,6 @@ Normally unique-id is a hash of the message. This method raises POPError if any problem happend. -: auth_only( account, password ) - (just for POP-before-SMTP) - - opens POP3 session, does authorization, then quit. - You must not call this method after POP3 session is opened. - - This method raises POPAuthenticationError if authentication is failed. - - # Typical usage - pop = Net::POP3.new('your.pop3.server') - pop.auth_only('Your account', 'Your password') - Net::SMTP.start(....) {|smtp| - .... - } - : reset reset the session. All "deleted mark" are removed. @@ -477,8 +469,8 @@ module Net @debug_output = nil @mails = nil - @nmails = nil - @bytes = nil + @n_mails = nil + @n_bytes = nil end def apop? @@ -565,21 +557,21 @@ module Net # POP protocol wrapper # - def mail_size - return @nmails if @nmails - @nmails, @bytes = command().stat - @nmails + def n_mails + return @n_mails if @n_mails + @n_mails, @n_bytes = command().stat + @n_mails end - def bytes - return @bytes if @bytes - @nmails, @bytes = command().stat - @bytes + def n_bytes + return @n_bytes if @n_bytes + @n_mails, @n_bytes = command().stat + @n_bytes end def mails return @mails.dup if @mails - if mail_size() == 0 + if n_mails() == 0 # some popd raises error for LIST on the empty mailbox. @mails = [] return [] -- cgit v1.2.3