build(args)
Class Public methods
Description
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:
123456789require
'uri'
uri =
URI
::
FTP
.build([
'user:password'
,
'ftp.example.com'
,
nil
,
'/path/file.> zip'
,
'i'
])
uri2 =
URI
::
FTP
.build({
:host
=>
'ftp.example.com'
,
:path
=>
'ruby/src'
})
puts uri2.to_s -> ftp://ftp.example.com/ruby/src
Please login to continue.