| Class | URI::Generic |
| In: |
lib/open-uri.rb
lib/uri/generic.rb |
| Parent: | Object |
| DEFAULT_PORT | = | nil |
| COMPONENT | = | [ :scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment |
| USE_REGISTRY | = | false |
| fragment | [R] | |
| host | [R] | |
| opaque | [R] | |
| path | [R] | |
| port | [R] | |
| query | [R] | |
| registry | [R] | |
| scheme | [R] |
See new
Creates a new URI::Generic instance from components of URI::Generic with check. Components are: scheme, userinfo, host, port, registry, path, opaque, query and fragment. You can provide arguments either by an Array or a Hash. See new for hash keys to use or for order of array items.
See new
At first, tries to create a new URI::Generic instance using URI::Generic::build. But, if exception URI::InvalidComponentError is raised, then it URI::Escape.escape all URI components and tries again.
| scheme: | Protocol scheme, i.e. ‘http’,’ftp’,’mailto’ and so on. |
| userinfo: | User name and password, i.e. ‘sdmitry:bla‘ |
| host: | Server host name |
| port: | Server port |
| registry: | DOC: FIXME! |
| path: | Path on server |
| opaque: | DOC: FIXME! |
| query: | Query data |
| fragment: | A part of URI after ’#’ sign |
| arg_check: | Check arguments [false by default] |
Creates a new URI::Generic instance from ``generic’’ components without check.
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 variable is case insensitive. CGI_HTTP_PROXY can be used instead.
ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.