Module | URI |
In: |
lib/more/facets/uri.rb
|
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
Input: the query string
Output: 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.
Input: the uri to filter (String) hash of parameters to update
Output: the full updated query string
TODO: optimize