1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

o protocol.rb, http.rb, smtp.rb, pop.rb: update RD documents

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2000-05-18 08:57:37 +00:00
parent 5ec582c9bd
commit 46fc347673
4 changed files with 50 additions and 22 deletions

View file

@ -23,18 +23,28 @@ module Net
== Class Methods == Class Methods
: new( address, port = 80 ) : new( address = 'localhost', port = 80 )
create new HTTP object. creates a new Net::HTTP object.
: start( address = 'localhost', port = 80 )
: start( address = 'localhost', port = 80 ) {|http| .... }
equals to Net::HTTP.new( address, port ).start
: port : port
returns HTTP default port, 80 HTTP default port, 80
: command_type : command_type
returns Command class, HTTPCommand Command class for Net::HTTP, HTTPCommand
== Methods == Methods
: start
: start {|http| .... }
creates a new Net::HTTP object and starts HTTP session.
When this method is called as iterator, gives HTTP object to block
and close HTTP session after block call finished.
: get( path, header = nil, dest = '' ) : get( path, header = nil, dest = '' )
: get( path, header = nil ) {|str| .... } : get( path, header = nil ) {|str| .... }
get data from "path" on connecting host. get data from "path" on connecting host.

View file

@ -28,21 +28,28 @@ Net::Protocol
=== Class Methods === Class Methods
: new( address = 'localhost', port = 110 ) : new( address = 'localhost', port = 110 )
This method create a new POP3 object. creates a new Net::POP3 object.
This will not open connection yet. This method does not open TCP connection yet.
: start( address = 'localhost', port = 110, *protoargs )
: start( address = 'localhost', port = 110, *protoargs ) {|pop| .... }
equals to Net::POP3.new( address, port ).start( *protoargs )
=== Methods === Methods
: start( account, password ) : start( account, password )
This method start POP3. : start( account, password ) {|pop| .... }
starts POP3 session.
: each{|popmail| ...} When called as iterator, give a POP3 object to block and
close session after block call is finished.
: each {|popmail| .... }
This method is equals to "pop3.mails.each" This method is equals to "pop3.mails.each"
: mails : mails
This method returns an array of ((URL:#POPMail)). an array of ((URL:#POPMail)).
This array is renewed when login. This array is renewed when session started.
=end =end

View file

@ -30,17 +30,15 @@ Object
: new( address = 'localhost', port = nil ) : new( address = 'localhost', port = nil )
This method Creates a new protocol object. This method Creates a new protocol object.
: start( address = 'localhost', port = nil, *args ) : start( address = 'localhost', port = nil, *protoargs )
: start( address = 'localhost', port = nil, *args ){|proto| .... } : start( address = 'localhost', port = nil, *protoargs ) {|proto| .... }
This method creates a new Protocol object and start session. This method creates a new Protocol object and opens a session.
If you call this method with block, Protocol object give itself equals to Net::Protocol.new( address, port ).start( *protoargs )
to block and finish session when block returns.
: Proxy( address, port ) : Proxy( address, port )
This method creates a proxy class of its protocol. This method creates a proxy class of its protocol.
Arguments are address/port of proxy host. Arguments are address/port of proxy host.
=== Methods === Methods
: address : address
@ -50,11 +48,15 @@ Object
connecting port number connecting port number
: start( *args ) : start( *args )
This method start protocol. If you call this method when the protocol : start( *args ) {|proto| .... }
is already started, this only returns false without doing anything. This method starts protocol. If protocol was already started,
do nothing and returns false.
'*args' are specified in subclasses. '*args' are specified in subclasses.
When is called as iterator, gives Protocol object to block and
close session when block finished.
: finish : finish
This method ends protocol. If you call this method before protocol starts, This method ends protocol. If you call this method before protocol starts,
it only return false without doing anything. it only return false without doing anything.

View file

@ -28,15 +28,24 @@ Net::Protocol
=== Class Methods === Class Methods
: new( address = 'localhost', port = 25 ) : new( address = 'localhost', port = 25 )
This method create new SMTP object. creates a new Net::SMTP object.
: start( address = 'localhost', port = 25, *protoargs )
: start( address = 'localhost', port = 25, *protoargs ) {|smtp| .... }
same to Net::SMTP.new( address, port ).start( *protoargs )
=== Methods === Methods
: start( helo_domain = ENV['HOSTNAME'] || ENV['HOST'], account = nil, password = nil, authtype = nil ) : start( helo_domain = Socket.gethostname, \
This method opens TCP connection and start SMTP. account = nil, password = nil, authtype = nil )
: start( helo_domain = Socket.gethostname, \
account = nil, password = nil, authtype = nil ) {|smtp| .... }
opens TCP connection and starts SMTP session.
If protocol had been started, do nothing and return false. If protocol had been started, do nothing and return false.
When this methods is called as iterator, give a SMTP object to block and
close session after block call finished.
If account and password are given, is trying to get authentication If account and password are given, is trying to get authentication
by using AUTH command. "authtype" is :plain (symbol) or :cram_md5. by using AUTH command. "authtype" is :plain (symbol) or :cram_md5.