Class: IRCSupport::Message::DCC::Accept

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

Direct Known Subclasses

Resume

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) ⇒ Accept

Returns a new instance of Accept.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/ircsupport/message.rb', line 263

def initialize(args)
  super(args)
  return if @dcc_args !~ /^(".+"|[^ ]+) +(\d+) +(\d+)/
  @filename = $1
  @port = $2.to_i
  @position = $3.to_i

  if @filename =~ /^"/
    @filename.gsub!(/^"|"$/, '')
    @filename.gsub!(/\\"/, '"');
  end

  @filename = Pathname.new(@filename).basename
end

Instance Attribute Details

#filenamePathname

Returns The source filename.

Returns:

  • (Pathname)

    The source filename.



254
255
256
# File 'lib/ircsupport/message.rb', line 254

def filename
  @filename
end

#portFixnum

Returns The sender’s port number.

Returns:

  • (Fixnum)

    The sender’s port number.



257
258
259
# File 'lib/ircsupport/message.rb', line 257

def port
  @port
end

#positionFixnum

Returns The byte position in the file.

Returns:

  • (Fixnum)

    The byte position in the file.



260
261
262
# File 'lib/ircsupport/message.rb', line 260

def position
  @position
end