Class: IRCSupport::Message::DCC::Accept
- Inherits:
-
IRCSupport::Message::DCC
- Object
- IRCSupport::Message
- IRCSupport::Message::DCC
- IRCSupport::Message::DCC::Accept
- Defined in:
- lib/ircsupport/message.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#filename ⇒ Pathname
The source filename.
-
#port ⇒ Fixnum
The sender’s port number.
-
#position ⇒ Fixnum
The byte position in the file.
Attributes inherited from IRCSupport::Message::DCC
Attributes inherited from IRCSupport::Message
Instance Method Summary collapse
-
#initialize(args) ⇒ Accept
constructor
A new instance of Accept.
Methods inherited from IRCSupport::Message
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
#filename ⇒ Pathname
Returns The source filename.
254 255 256 |
# File 'lib/ircsupport/message.rb', line 254 def filename @filename end |
#port ⇒ Fixnum
Returns The sender’s port number.
257 258 259 |
# File 'lib/ircsupport/message.rb', line 257 def port @port end |
#position ⇒ Fixnum
Returns The byte position in the file.
260 261 262 |
# File 'lib/ircsupport/message.rb', line 260 def position @position end |