Contents:
Description
Create a new URI::FTP object from ``generic’’ components with no check.
Usage
require 'uri' p ftp = URI.parse("ftp://ftp.ruby-lang.org/pub/ruby/;type=d") # => #<URI::FTP:0x201fad08 URL:ftp://ftp.ruby-lang.org/pub/ruby/;type=d> p ftp.typecode # => "d"
Source Code
# File uri/ftp.rb, line 86 def initialize(*arg) super(*arg) @typecode = nil tmp = @path.index(TYPECODE_PREFIX) if tmp typecode = @path[tmp + TYPECODE_PREFIX.size..-1] self.set_path(@path[0..tmp - 1]) if arg[-1] self.typecode = typecode else self.set_typecode(typecode) end end end
<code/>and<pre/>for code samples.