diff options
| author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 23:20:44 +0000 |
|---|---|---|
| committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 23:20:44 +0000 |
| commit | 82322e5d4b5943f2f1791133ed2dbcc06316638f (patch) | |
| tree | ae435ccaba05f21c00d1f9887603147ff12cb038 /ext/socket/lib | |
| parent | 28d8d87812ff93d91d2881de389f8a20934f2d97 (diff) | |
* backport r32977 from trunk
* ext/socket: Make Socket documentation appear. Add documentation for
Socket, TCPServer, SOCKSSocket. Patch by Sylvain Daubert.
[Ruby 1.9 - Feature #5182]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/lib')
| -rw-r--r-- | ext/socket/lib/socket.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb index 621a60c9f6..d311eed28d 100644 --- a/ext/socket/lib/socket.rb +++ b/ext/socket/lib/socket.rb @@ -643,17 +643,28 @@ class Socket < BasicSocket # UDP/IP address information used by Socket.udp_server_loop. class UDPSource + # +remote_adress+ is an Addrinfo object. + # + # +local_adress+ is an Addrinfo object. + # + # +reply_proc+ is a Proc used to send reply back to the source. def initialize(remote_address, local_address, &reply_proc) @remote_address = remote_address @local_address = local_address @reply_proc = reply_proc end - attr_reader :remote_address, :local_address - def inspect + # Address of the source + attr_reader :remote_address + + # Local address + attr_reader :local_address + + def inspect # :nodoc: "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>" end + # Sends the String +msg+ to the source def reply(msg) @reply_proc.call msg end |
