find_proxy

find_proxy() Instance Public methods returns a proxy URI. The proxy URI is obtained from environment variables such as http_proxy, ftp_proxy, no_proxy, etc. If there is no proper proxy, nil is returned. Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.) are examined too. But http_proxy and HTTP_PROXY is treated specially under CGI environment. It's because HTTP_PROXY may be set by Proxy: header. So HTTP_PROXY is not used. http_proxy is not used too if the varia

fragment=

fragment=(v) Instance Public methods Args v String Description public setter for the fragment component v. (with validation) see also URI::Generic.check_fragment Usage require 'uri' uri = URI.parse("http://my.example.com/?id=25#time=1305212049") uri.fragment = "time=1305212086" # => "time=1305212086" uri #=> #<URI::HTTP:0x000000007a81f8 URL:http://my.example.com/?id=25#time=1305212086>

hash

hash() Instance Public methods

hierarchical?

hierarchical?() Instance Public methods Checks if URI has a path

host=

host=(v) Instance Public methods Args v String Description public setter for the host component v. (with validation) see also URI::Generic.check_host Usage require 'uri' uri = URI.parse("http://my.example.com") uri.host = "foo.com" # => "foo.com" uri #=> #<URI::HTTP:0x000000008e89e8 URL:http://foo.com>

hostname

hostname() Instance Public methods extract the host part of the URI and unwrap brackets for IPv6 addresses. This method is same as #host except brackets for IPv6 (andn future IP) addresses are removed. u = URI(âhttp://[::1]/barâ) p u.hostname #=> â::1â p u.host #=> â[::1]â

hostname=

hostname=(v) Instance Public methods set the host part of the URI as the argument with brackets for IPv6 addresses. This method is same as #host= except the argument can be bare IPv6 address. u = URI(âfoo/barâ) p u.to_s #=> âfoo/barâ u.hostname = â::1â p u.to_s #=> â[::1]/barâ If the arugument seems IPv6 address, it is wrapped by brackets.

inspect

inspect() Instance Public methods

merge

merge(oth) Instance Public methods Args oth URI or String Description Merges two URI's. Usage require 'uri' uri = URI.parse("http://my.example.com") p uri.merge("/main.rbx?page=1") # => #<URI::HTTP:0x2021f3b0 URL:http://my.example.com/main.rbx?page=1> +

merge!

merge!(oth) Instance Public methods Args oth URI or String Description Destructive form of merge Usage require 'uri' uri = URI.parse("http://my.example.com") uri.merge!("/main.rbx?page=1") p uri # => #<URI::HTTP:0x2021f3b0 URL:http://my.example.com/main.rbx?page=1>