README.md in erp_integration-0.2.0 vs README.md in erp_integration-0.3.0

- old
+ new

@@ -30,9 +30,32 @@ config.fulfil_api_key = '<your-api-key>' config.fulfil_merchant_id = '<your-merchant-id>' end ``` +### Querying third-party vendors + +After configuring the gem, one can easily query all the available ERP resources from the connected third-parties. + +```ruby +$ ErpIntegration::Order.where(reference: 'MT1000SKX') +=> #<ErpIntegration::Fulfil::Collection @items=[<ErpIntegration::Order @id=100 />] /> +``` + +By default, only the `id` will be added to the found ERP resources. However, one can use the `select` method to include more fields. + +```ruby +$ ErpIntegration::Order.select(:id, :reference).where(reference: 'MT1000SKX') +=> #<ErpIntegration::Fulfil::Collection @items=[<ErpIntegration::Order @id=100 @reference=MT1000SKX />] /> +``` + +There are also other type of `where` queries available: +- `where_like` for case sensitive queries. +- `where_ilike` for case insensitive queries. +- `where_not` for non-equality queries. +- `where_in` for inclusion queries. +- `where_not_in` for exclusion queries. + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. TODO: Write instructions for publishing the gem to the Github package registry.