Module | URI |
In: |
lib/more/facets/uri.rb
|
KEY_VALUE_SEPARATOR | = | ";" |
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"
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