Components of the URI
in the order.
Components of the URI
in the order.
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 path component v
(with validation).
See also URI::Generic.check_path
.
require 'uri' uri = URI.parse("http://my.example.com/pub/files") uri.path = "/faq/" uri.to_s #=> "http://my.example.com/faq/"
v
Public setter for the query component v
.
require 'uri' uri = URI.parse("http://my.example.com/?id=25") uri.query = "id=1" uri.to_s #=> "http://my.example.com/?id=1"
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"
Selects specified components from URI
.
require 'uri' uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx') uri.select(:userinfo, :host, :path) # => ["myuser:mypass", "my.example.com", "/test.rbx"]
Attempts to parse other URI
oth
, returns [parsed_oth, self].
require 'uri' uri = URI.parse("http://my.example.com") uri.coerce("http://foo.com") #=> [#<URI::HTTP http://foo.com>, #<URI::HTTP http://my.example.com>]
Returns scope.
Setter for scope val
.
Returns filter.
Setter for filter val
.
Returns a Hash
(not a DBM
database) created by using each value in the database as a key, with the corresponding key as its value.
Note that all values in the hash will be Strings, but the keys will be actual objects.
If a block is provided, returns a new array containing [key, value] pairs for which the block returns true.
Otherwise, same as values_at
Returns true
if this process is stopped, and if the corresponding wait call had the Process::WUNTRACED flag set, false
otherwise.
Returns the number of the signal that caused the process to stop, or nil
if the process is not stopped.
Returns the number of the signal that caused the process to terminate or nil
if the process was not terminated by an uncaught signal.
Called when the current thread exits. The scheduler is expected to implement this method in order to allow all waiting fibers to finalize their execution.
The suggested pattern is to implement the main event loop in the close
method.
Implementation of the Fiber.schedule
. The method is expected to immediately run the given block of code in a separate non-blocking fiber, and to return that Fiber
.
Minimal suggested implementation is:
def fiber(&block) fiber = Fiber.new(blocking: false, &block) fiber.resume fiber end