build(args) public


Creates a new URI::FTP object from components, with syntax checking.

The components accepted are userinfo, host, port, path, and typecode.

The components should be provided either as an Array, or as a Hash with keys formed by preceding the component names with a colon.

If an Array is used, the components must be passed in the order [userinfo, host, port, path, typecode].

If the path supplied is absolute, it will be escaped in order to make it absolute in the URI.


require 'uri'

uri1 =['user:password', '', nil,
  '/path/', 'i'])
uri1.to_s  # => ";type=i"

uri2 ={:host => '',
  :path => 'ruby/src'})
uri2.to_s  # => ""
Show source
Register or log in to add new notes.