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. Examples:

require 'uri'

uri =['user:password', '', nil, 
  '/path/file.> zip', 'i'])
puts uri.to_s  ->;type=a

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