URI::Parser.new([opts])
The constructor accepts a hash as options for parser. Keys of options are pattern names of URI
components and values of options are pattern strings. The constructor generates set of regexps for parsing URIs.
You can use the following keys:
* :ESCAPED (URI::PATTERN::ESCAPED in default) * :UNRESERVED (URI::PATTERN::UNRESERVED in default) * :DOMLABEL (URI::PATTERN::DOMLABEL in default) * :TOPLABEL (URI::PATTERN::TOPLABEL in default) * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})") u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP http://example.jp/%uABCD> URI.parse(u.to_s) #=> raises URI::InvalidURIError s = "http://example.com/ABCD" u1 = p.parse(s) #=> #<URI::HTTP http://example.com/ABCD> u2 = URI.parse(s) #=> #<URI::HTTP http://example.com/ABCD> u1 == u2 #=> true u1.eql?(u2) #=> false
Returns a split URI
against regexp[:ABS_URI]
.
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>
str
String
to search
schemes
Patterns to apply to str
Attempts to parse and merge a set of URIs. If no block
given, then returns the result, else it calls block
for each element in result.
See also URI::Parser.make_regexp
.
Constructs a safe String
from str
, removing unsafe characters, replacing them with codes.
Removes escapes from str
.
Returns Regexp
that is default self.regexp[:ABS_URI_REF]
, unless schemes
is provided. Then it is a Regexp.union
with self.pattern[:X_ABS_URI]
.
Constructs the default Hash
of patterns.
Constructs the default Hash
of Regexp’s.
Error raised by the DRbProtocol
module when it cannot find any protocol implementation support the scheme specified in a URI
.
Response class for URI Too Long
responses (status code 414).
The URI
provided was too long for the server to process.
References:
Response class for URI Too Long
responses (status code 414).
The URI
provided was too long for the server to process.
References:
Response class for URI Too Long
responses (status code 414).
The URI
provided was too long for the server to process.
References:
Represents the use of the ‘&&=` operator for assignment to a class variable.
@@target &&= value ^^^^^^^^^^^^^^^^^^
Represents assigning to a class variable using an operator that isn’t ‘=`.
@@target += value ^^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator for assignment to a class variable.
@@target ||= value ^^^^^^^^^^^^^^^^^^
Represents the use of the ‘&&=` operator for assignment to a global variable.
$target &&= value ^^^^^^^^^^^^^^^^^
Represents assigning to a global variable using an operator that isn’t ‘=`.
$target += value ^^^^^^^^^^^^^^^^
Represents the use of the ‘||=` operator for assignment to a global variable.
$target ||= value ^^^^^^^^^^^^^^^^^
Represents the use of the ‘&&=` operator for assignment to an instance variable.
@target &&= value ^^^^^^^^^^^^^^^^^