|
| 1 | +**Currently a work in progress** |
| 2 | + |
| 3 | +A Ruby wrapper around the [bol.com developers API][docs], that will be made |
| 4 | +available as a Gem. Currently in pre-alpha stage. |
| 5 | + |
| 6 | +[docs]: http://developers.bol.com |
| 7 | + |
| 8 | +## Available operations |
| 9 | + |
| 10 | +Here's an overview of all the operations that should be implemented: |
| 11 | + |
1 | 12 | ```ruby
|
2 | 13 | Bol::Category.find(params[:id]).products
|
3 | 14 | Bol::Category.find(params[:id]).subcategories
|
4 | 15 | Bol::Category.find(params[:id]).top_products
|
5 |
| -Bol::Category.find(params[:id]).search() |
| 16 | +Bol::Category.find(params[:id]).search(params[:query]) |
6 | 17 | Bol::Product.find(params[:id])
|
7 | 18 | Bol::Product.search(params[:query]).limit(10).offset(10).order('sales_ranking ASC')
|
8 | 19 | Bol::Product.search(params[:query]).page(params[:page])
|
9 | 20 | ```
|
10 | 21 |
|
| 22 | +These simply map to operations provided by the API to search, load lists of |
| 23 | +products or load a single product by ID. I do aim to a add a little sugar |
| 24 | +to make working with Ruby objects a little easier: |
| 25 | + |
| 26 | +* Add `page` helper method to combine `limit` and `offset` |
| 27 | +* Scope operations by category in a ActiveRecord association style |
| 28 | +* Delay API calls until explicitly requested or triggered by looping over |
| 29 | + results |
| 30 | + |
| 31 | +## Configuration |
| 32 | + |
11 | 33 | ```ruby
|
12 | 34 | Bol.configure do |c|
|
13 |
| - c.key = '...' |
14 |
| - c.secret = '' |
| 35 | + c.key = 'your public access key' |
| 36 | + c.secret = 'your private secret' |
15 | 37 | c.per_page = 10
|
16 | 38 | c.default_order = 'sales_ranking'
|
17 | 39 | end
|
18 | 40 | ```
|
| 41 | + |
| 42 | +## Note on Patches/Pull Requests |
| 43 | + |
| 44 | +* Fork the project. |
| 45 | +* Make your feature addition or bug fix. |
| 46 | +* Add tests for it. This is important so I don't break it in a future version |
| 47 | + unintentionally. |
| 48 | +* Commit, do not mess with rakefile, version, or history. (if you want to have |
| 49 | + your own version, that is fine but bump version in a commit by itself I can |
| 50 | + ignore when I pull) |
| 51 | +* Send me a pull request. Bonus points for topic branches. |
| 52 | + |
| 53 | +## History |
| 54 | + |
| 55 | +For a full list of changes, please see CHANGELOG.md |
| 56 | + |
| 57 | +## License |
| 58 | + |
| 59 | +Copyright (C) 2011 by Arjan van der Gaag. Published under the MIT license. See |
| 60 | +LICENSE.md for details. |
0 commit comments