Picky Client
Usage
-
Define a client instance, and save it (as an example) in a constant:
BookSearch = Picky::Client.new :host => 'some_host', :port => 1234, :path => '/path/to/search'
-
Use it in your controllers to search:
result = BookSearch.search :query => 'some query', :offset => 123, :ids => 20 # This gets you a hash
-
Then, to make access easier (if needed):
result.extend Picky::Convenience
-
This gets you the following methods on result:
- empty?
- ids(limit=20)
- clear_ids
- allocations
- allocations_size
- total