Class: IRCSupport::Message::DCC::Chat

Inherits:
IRCSupport::Message::DCC show all
Defined in:
lib/ircsupport/message.rb

Instance Attribute Summary collapse

Attributes inherited from IRCSupport::Message::DCC

#dcc_args, #dcc_type, #sender

Attributes inherited from IRCSupport::Message

#args, #command, #prefix

Instance Method Summary collapse

Methods inherited from IRCSupport::Message

#type

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

#addressIPAddr

Returns The sender’s IP address.

Returns:

  • (IPAddr)

    The sender’s IP address.



207
208
209
# File 'lib/ircsupport/message.rb', line 207

def address
  @address
end

#portFixnum

Returns The sender’s port number.

Returns:

  • (Fixnum)

    The sender’s port number.



210
211
212
# File 'lib/ircsupport/message.rb', line 210

def port
  @port
end