.oooooo. ooooo ooooo ooooooooooooo
d8P' `Y8b `888' `888' 8' 888 `8
888 888 888 888
888 888 888 888
888 ooooo 888 888 888
`88. .88' 888 888 o 888
`Y8bood8P' o888o o888ooood8 o888o
gilt
is a Ruby library for v1 of the Gilt Public API.
It's written with the Weary framework, so it gets the features of that library out of the box, like:
- Full Rack integration. The Client to the library is a Rack application.
- Fully asynchronous.
gilt
makes liberal use of futures and Weary::Deferred.
Examples
active_sales = Gilt::Sale.active :apikey => "your-api-key"
womens_sales = sales.select {|sale| sale.store == Gilt::Stores::WOMEN }
sales.products.map(&:name)
Above, the call to sales.products
returns a list of Weary::Deferred objects wrapping Gilt::Product objects. This means that fetching the product is asynchronous, and only blocks when accessed.
With Rack
# config.ru
client = Gilt::Client::Product
client.use Rack::Runtime
run client
After rackup
:
curl "http://localhost:9292/sales/active.json?apikey=my-api-key"
Installation
gem install gilt