Returns the parser to be used.
Unless a URI::Parser
is defined, DEFAULT_PARSER is used.
v
Public setter for the scheme component v
(with validation).
See also URI::Generic.check_scheme
.
require 'uri' uri = URI.parse("http://my.example.com") uri.scheme = "https" uri.to_s #=> "https://my.example.com"
v
Public setter for the password
component (with validation).
See also URI::Generic.check_password
.
require 'uri' uri = URI.parse("http://john:S3nsit1ve@my.example.com") uri.password = "V3ry_S3nsit1ve" uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com"
Returns the password component (without URI
decoding).
v
Public setter for the opaque component v
(with validation).
See also URI::Generic.check_opaque
.
Checks the fragment v
component against the URI::Parser
Regexp
for :FRAGMENT.
v
Public setter for the fragment component v
(with validation).
require 'uri' uri = URI.parse("http://my.example.com/?id=25#time=1305212049") uri.fragment = "time=1305212086" uri.to_s #=> "http://my.example.com/?id=25#time=1305212086"
Returns true if URI
does not have a scheme (e.g. http:// or https://) specified.
Destructive form of merge
.
require 'uri' uri = URI.parse("http://my.example.com") uri.merge!("/main.rbx?page=1") uri.to_s # => "http://my.example.com/main.rbx?page=1"
Merges two URIs.
require 'uri' uri = URI.parse("http://my.example.com") uri.merge("/main.rbx?page=1") # => "http://my.example.com/main.rbx?page=1"
Returns attributes.
Setter for attributes val
.
uri
Parses uri
and constructs either matching URI
scheme object (File
, FTP
, HTTP
, HTTPS
, LDAP
, LDAPS
, or MailTo
) or URI::Generic
.
p = URI::Parser.new p.parse("ldap://ldap.example.com/dc=example?user=john") #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
uri
Parses uri
and constructs either matching URI
scheme object (File
, FTP
, HTTP
, HTTPS
, LDAP
, LDAPS
, or MailTo
) or URI::Generic
.
p = URI::Parser.new p.parse("ldap://ldap.example.com/dc=example?user=john") #=> #<URI::LDAP ldap://ldap.example.com/dc=example?user=john>
Updates the database with multiple values from the specified object. Takes any object which implements the each_pair
method, including Hash
and DBM
objects.
Returns self
.
Returns true
if the process terminated because of an uncaught signal, false
otherwise.
Returns the least significant eight bits of the return code of the process if it has exited; nil
otherwise:
`exit 99` $?.exitstatus # => 99