static public Method

FTP.new(*arg)

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.