Yields each source URI
in the list.
Default fetcher instance. Use this instead of ::new
to reduce object allocation.
Enumerate every known spec. See ::dirs=
and ::add_spec to set the list of specs.
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"
Returns true if URI
is hierarchical.
URI
has components listed in order of decreasing significance from left to right, see RFC3986 tools.ietf.org/html/rfc3986 1.2.3.
require 'uri' uri = URI.parse("http://my.example.com/") uri.hierarchical? #=> true uri = URI.parse("mailto:joe@example.com") uri.hierarchical? #=> false
Return value associated with key
.
If there is no value for key
and no block is given, returns ifnone
.
Otherwise, calls block passing in the given key
.
See ::DBM#fetch
for more information.
Returns the number of the signal that caused stat to stop (or nil
if self is not stopped).
Similar to read, but raises EOFError
at end of string instead of returning nil
, as well as IO#sysread
does.
Executes the block for every line in the stream where lines are separated by eol.
See also gets
Reads a one-character string from the stream. Raises an EOFError
at end of file.
Generate a Checkbox Input element as a string.
The attributes of the element can be specified as three arguments, name
, value
, and checked
. checked
is a boolean value; if true, the CHECKED attribute will be included in the element.
Alternatively, the attributes can be specified as a hash.
checkbox("name") # = checkbox("NAME" => "name") checkbox("name", "value") # = checkbox("NAME" => "name", "VALUE" => "value") checkbox("name", "value", true) # = checkbox("NAME" => "name", "VALUE" => "value", "CHECKED" => true)
Returns the header field corresponding to the case-insensitive key. Returns the default value args
, or the result of the block, or raises an IndexError
if there’s no header field named key
See Hash#fetch