Contents:
Args
| 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] |
Description
Creates a new URI::Generic instance from ``generic’’ components without check.
Source Code
# File uri/generic.rb, line 156 def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, arg_check = false) @scheme = nil @user = nil @password = nil @host = nil @port = nil @path = nil @query = nil @opaque = nil @registry = nil @fragment = nil if arg_check self.scheme = scheme self.userinfo = userinfo self.host = host self.port = port self.path = path self.query = query self.opaque = opaque self.registry = registry self.fragment = fragment else self.set_scheme(scheme) self.set_userinfo(userinfo) self.set_host(host) self.set_port(port) self.set_path(path) self.set_query(query) self.set_opaque(opaque) self.set_registry(registry) self.set_fragment(fragment) end if @registry && !self.class.use_registry raise InvalidURIError, "the scheme #{@scheme} does not accept registry part: #{@registry} (or bad hostname?)" end @scheme.freeze if @scheme self.set_path('') if !@path && !@opaque # (see RFC2396 Section 5.2) self.set_port(self.default_port) if self.default_port && !@port end
<code/>and<pre/>for code samples.