Skip to content

Commit

Permalink
Use dig shorthand in README and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanensari committed Oct 11, 2024
1 parent 0193f0f commit 2fd7ab5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/281e6176048f3c0a1ed3/maintainability)][maintainability]
[![Test Coverage](https://api.codeclimate.com/v1/badges/281e6176048f3c0a1ed3/test_coverage)][test-coverage]

> ⚠️ This README explains the main branch, which may contain unreleased code. For the README of the latest release, please refer to [this link][latest-release-readme].
**Peddler** is a Ruby interface to the [Amazon Selling Partner API (SP-API)][docs-overview]. The SP-API enables Amazon sellers and vendors to programmatically access their data on orders, shipments, payments, and more.

To begin using the Amazon SP-API, you must [register as a developer][register-as-developer] and [register your application][register-application]. Once registered, [obtain your Login with Amazon (LWA) credentials][view-credentials] to access your own or other selling partners' data.
Expand Down Expand Up @@ -113,7 +115,7 @@ response = api.get_catalog_item(
marketplaceIds: ["ATVPDKIKX0DER"],
asin: "B08N5WRWNW"
)
items = response.parse.dig("items")
items = response.dig("items")
```

#### Orders API (v0)
Expand All @@ -126,7 +128,7 @@ response = api.get_orders(
marketplaceIds: ["ATVPDKIKX0DER"],
createdAfter: "2023-01-01T00:00:00Z"
)
response.parse.dig("orders")
response.dig("orders")
```

#### Feeds API (2021-06-30)
Expand Down Expand Up @@ -496,6 +498,7 @@ response.parse
[build]: https://github.com/hakanensari/peddler/actions
[maintainability]: https://codeclimate.com/github/hakanensari/peddler/maintainability
[test-coverage]: https://codeclimate.com/github/hakanensari/peddler/test_coverage
[latest-release-readme]: https://github.com/lineofflight/peddler/tree/v3.0.0
[docs-overview]: https://developer.amazonservices.com/sp-api-docs/overview
[register-as-developer]: https://developer-docs.amazon.com/sp-api/docs/registering-as-a-developer
[register-application]: https://developer-docs.amazon.com/sp-api/docs/registering-your-application
Expand Down
2 changes: 1 addition & 1 deletion test/peddler/api/feeds_2021_06_30_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_get_feed_document
assert_predicate(res.status, :ok?)

# Just exploring the result feed document
url = res.parse.dig("url")
url = res.dig("url")
res = HTTP.get(url)
body = Zlib::GzipReader.new(res).read

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_get_definitions_product_type
assert_predicate(res.status, :ok?)

# And download the JSON schema
url = res.parse.dig("schema", "link", "resource")
url = res.dig("schema", "link", "resource")
json_schema = HTTP.get(url).parse(:json)

assert(json_schema)
Expand Down

0 comments on commit 2fd7ab5

Please sign in to comment.