Class: IRCSupport::Message::DCC::Chat
- Inherits:
-
IRCSupport::Message::DCC
- Object
- IRCSupport::Message
- IRCSupport::Message::DCC
- IRCSupport::Message::DCC::Chat
- Defined in:
- lib/ircsupport/message.rb
Instance Attribute Summary collapse
-
#address ⇒ IPAddr
The sender’s IP address.
-
#port ⇒ Fixnum
The sender’s port number.
Attributes inherited from IRCSupport::Message::DCC
Attributes inherited from IRCSupport::Message
Instance Method Summary collapse
-
#initialize(args) ⇒ Chat
constructor
A new instance of Chat.
Methods inherited from IRCSupport::Message
Constructor Details
#initialize(args) ⇒ Chat
Returns a new instance of Chat.
213 214 215 216 217 218 |
# File 'lib/ircsupport/message.rb', line 213 def initialize(args) super(args) return if @dcc_args !~ /^(?:".+"|[^ ]+) +(\d+) +(\d+)/ @address = IPAddr.new($1.to_i, Socket::AF_INET) @port = $2.to_i end |
Instance Attribute Details
#address ⇒ IPAddr
Returns The sender’s IP address.
207 208 209 |
# File 'lib/ircsupport/message.rb', line 207 def address @address end |
#port ⇒ Fixnum
Returns The sender’s port number.
210 211 212 |
# File 'lib/ircsupport/message.rb', line 210 def port @port end |