Sha256: 4e7414f4af268679c64a3f6017aad18647cc28cd39902df98f281ac330cfde34

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

# URI query_params

* [Source](http://github.com/postmodern/uri-query_params/)
* [Issues](http://github.com/postmodern/uri-query_params/issues/)
* Postmodern (postmodern.mod3 at gmail.com)

## Description

Allows access to the query component of the URI as a Hash. This is similar
to `$_GET` from PHP, except available on any {URI::HTTP} object.

## Examples

Inspecting the URI query_params:

    require 'uri/query_params'
    
    url = URI('http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=1HY&q=bob+ross&btnG=Search')
    url.query_params
    # => {"btnG"=>"Search", "hs"=>"1HY", "rls"=>"org.mozilla:en-US:official", "client"=>"firefox-a", "hl"=>"en", "q"=>"bob+ross"}

    url.query_params['q']
    # => "bob+ross"

Setting the URI query_params:

    url.query_params['q'] = 'Upright Citizens Brigade'
    url.to_s
    # => "http://www.google.com/search?btnG=Search&hs=1HY&rls=org.mozilla:en-US:official&client=firefox-a&hl=en&q=Upright%20Citizens%20Brigade"

## Install

    $ sudo gem install uri-query_params

## License

See {file:LICENSE.txt} for license information.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uri-query_params-0.5.2 README.md