README.md in peddler-1.5.0 vs README.md in peddler-1.6.0
- old
+ new
@@ -1,10 +1,10 @@
# Peddler
[![Build Status](https://travis-ci.org/hakanensari/peddler.svg)](https://travis-ci.org/hakanensari/peddler)
[![Code Climate](https://codeclimate.com/github/hakanensari/peddler/badges/gpa.svg)](https://codeclimate.com/github/hakanensari/peddler)
-[![Coverage Status](https://coveralls.io/repos/hakanensari/peddler/badge.svg?branch=master)](https://coveralls.io/r/hakanensari/peddler?branch=master)
+[![Test Coverage](https://codeclimate.com/github/hakanensari/peddler/badges/coverage.svg)](https://codeclimate.com/github/hakanensari/peddler/coverage)
**Peddler** is a Ruby interface to the [Amazon MWS API](https://developer.amazonservices.com/), a collection of web services that help Amazon sellers programmatically exchange data on their listings, orders, payments, reports, and more.
To use Amazon MWS, you must have an eligible seller account and register for MWS. This applies to developers as well.
@@ -42,10 +42,12 @@
```ruby
client = MWS.orders
```
+The client will pick up credentials automatically from the environment.
+
Alternatively, if you do not rely on environment variables, you can set some or all credentials when or after creating the client.
```ruby
client = MWS.orders(
primary_marketplace_id: "Your Marketplace ID",
@@ -61,12 +63,10 @@
```ruby
client = MWS.orders(
primary_marketplace_id: "Seller's Marketplace ID",
merchant_id: "Seller's Merchant or Seller ID",
- aws_access_key_id: "Your AWS Access Key ID",
- aws_secret_access_key: "Your AWS Secret Access Key",
auth_token: "Seller's MWS Authorisation Token"
)
```
Once you have a client with valid credentials, you should be able to make requests to the API. Clients map operation names in a flat structure. Methods have positional arguments for required input and keyword arguments for optional parameters. Both method and argument names are underscored but otherwise identical to the names of the corresponding operations and parameters documented in the API.
@@ -75,11 +75,12 @@
Peddler wraps successful responses in a parser that handles both XML documents and flat files:
```ruby
parser = client.get_service_status
-parser.parse # will return a Hash or CSV object
+parser.parse # will return a Hash object
+parser.dig('Status') # delegates to Hash#dig for convenience
```
You can swap the default parser with a purpose-built abstraction.
```ruby
@@ -88,10 +89,10 @@
For a sample implementation, see my [MWS Orders](https://github.com/hakanensari/mws-orders) library.
### Debugging
-To introspect requests, set the `EXCON_DEBUG` environment variable to a truthy value.
+To introspect requests, set the `EXCON_DEBUG` environment variable to a truthy value when making requests.
### Errors
Handle network errors caused by throttling or other transient issues by defining an error handler.