Module URI
In: lib/more/facets/uri.rb

Methods

Classes and Modules

Module URI::Hash
Module URI::Kernel

Constants

KEY_VALUE_SEPARATOR = ";"  

Public Instance methods

CGI escape

TODO: How does this compare to URI.escape?

Removes the query string from a uri.

Returns the chomped uri.

Decode the uri components.

This method returns the query string of a uri

Input: the uri

Output: the query string. returns nil if no query string

Given a hash with parameter/value pairs construct a standard query string.

  URI.hash_to_query(:a => 1, :b => 2)
  #=> "a=1;b=2"
hash_to_query_string(parameters)

Alias for hash_to_query

query_string_to_hash(query_string)

Alias for query_to_hash

Extend the basic query string parser provided by the cgi module. converts single valued params (the most common case) to objects instead of arrays

Returns hash of parameters, contains arrays for multivalued parameters (multiselect, checkboxes , etc).

If no query string is provided (nil or "") returns an empty hash.

Get a uri and a hash of parameters. Inject the hash values as parameters in the query sting path. Returns the full uri.

uri - the uri to filter (String) parameter - hash of parameters to update

Returns the full updated query string.

TODO: optimize

Gets the request uri, injects extra parameters in the query string and returns a new uri. The request object is not modified. There is always a qs string so an extra test is skipped.

TODO: find a better name?

[Validate]