callback

callback(id, name1, name2, op) Class Public methods def ::callback

split

split(uri) Class Public methods Synopsis URI::split(uri) Args uri String with URI. Description Splits the string on following parts and returns array with result: * Scheme * Userinfo * Host * Port * Registry * Path * Opaque * Query * Fragment Usage require 'uri' p URI.split("http://www.ruby-lang.org/") # => ["http", nil, "www.ruby-lang.org", nil, nil, "/", nil, nil, nil]

scheme_list

scheme_list() Class Public methods Returns a Hash of the defined schemes

regexp

regexp(schemes = nil) Class Public methods Synopsis URI::regexp([match_schemes]) Args match_schemes Array of schemes. If given, resulting regexp matches to URIs whose scheme is one of the match_schemes. Description Returns a Regexp object which matches to URI-like strings. The Regexp object returned by this method includes arbitrary number of capture group (parentheses). Never rely on it's number. Usage require 'uri' # extract first URI from html_string html_string.slice(U

parse

parse(uri) Class Public methods Synopsis URI::parse(uri_str) Args uri_str String with URI. Description Creates one of the URI's subclasses instance from the string. Raises URI::InvalidURIError Raised if URI given is not a correct one. Usage require 'uri' uri = URI.parse("http://www.ruby-lang.org/") p uri # => #<URI::HTTP:0x202281be URL:http://www.ruby-lang.org/> p uri.scheme # => "http" p uri.host # => "www.ruby-lang.org"

join

join(*str) Class Public methods Synopsis URI::join(str[, str, ...]) Args str String(s) to work with Description Joins URIs. Usage require 'uri' p URI.join("http://example.com/","main.rbx") # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx> p URI.join('http://example.com', 'foo') # => #<URI::HTTP:0x01ab80a0 URL:http://example.com/foo> p URI.join('http://example.com', '/foo', '/bar') # => #<URI::HTTP:0x01aaf0b0 URL:http://example.com/bar>

extract

extract(str, schemes = nil, &block) Class Public methods Synopsis URI::extract(str[, schemes][,&blk]) Args str String to extract URIs from. schemes Limit URI matching to a specific schemes. Description Extracts URIs from a string. If block given, iterates through all matched URIs. Returns nil if block given or array with matches. Usage require "uri" URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.") # => ["http:

encode_www_form_component

encode_www_form_component(str) Class Public methods Encode given str to URL-encoded form data. This method doesn't convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP (ASCII space) to + and converts others to %XX. This is an implementation of www.w3.org/TR/html5/association-of-controls-and-forms.html#url-encoded-form-data See ::decode_www_form_component, ::encode_www_form

encode_www_form

encode_www_form(enum) Class Public methods Generate URL-encoded form data from given enum. This generates application/x-www-form-urlencoded data defined in HTML5 from given an Enumerable object. This internally uses ::encode_www_form_component. This method doesn't convert the encoding of given items, so convert them before call this method if you want to send data as other than original encoding or mixed encoding data. (Strings which are encoded in an HTML5 ASCII incompatible encod

decode_www_form_component

decode_www_form_component(str, enc=Encoding::UTF_8) Class Public methods Decode given str of URL-encoded form data. This decodes + to SP. See ::encode_www_form_component, ::decode_www_form