chrismagnacca/newegg-api — pull request #2 by bencpeters (2014-01-06 22:46:56+00:00)
Title: More flexible search specification

Changed API::search to take a hash of arguments. Newegg's API search endpoint is quite flexible in terms of what it accepts as a valid query specification and it seems to me that there are times when it is valuable to not need to specify all of store_id, category_id, sub_category_id, and node_id. The most obvious of this is a simple keyword search; if all of the above are set to nil, but a Keyword is provided, Newegg has no trouble with the request, and this seems to be a useful use case to support.

The proposed new signature for the search method and argument defaults:

```ruby
def search(options={})
options = {store_id: nil, category_id: nil, sub_category_id: nil, node_id: nil, page_number: 1, sort: "FEATURED",
keywords: ""}.merge(options)
```