carriage 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +23 -1
- data/lib/carriage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af9360776787d7e2a4e9f4f2317d77b310559699a9b7d7b923eacf1b198d822
|
4
|
+
data.tar.gz: dc7403b2856a523a108fc747a52a6951a321ddfe93e80212fb4de6ac830a38ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caba7b6c2482adcc6a1c6c18cff1aa7cc5daefe206cab983931dac12718d48007c1fa6d7ad0e1bd36b207fc8740b01426f00ef8414e7304473e6d0f2f770b1b2
|
7
|
+
data.tar.gz: 6a3461068f08071bb4a686212794952426978ffd28a620ef138ebcf779bae22075b6ec2be7f1abee2a586800691999a4da8158dd8d1fbc09a1f944b1dece5d53
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -27,7 +27,29 @@ Or install it yourself as:
|
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
-
|
30
|
+
A lot of examples could be found [in tests](https://github.com/skatkov/carriage/blob/master/test/carriage_test.rb)
|
31
|
+
|
32
|
+
There are basically two ways to use this gem `bare metal` and with `builder`. Let's start off with baremetal:
|
33
|
+
|
34
|
+
### Bare metal
|
35
|
+
```
|
36
|
+
Carriage.call(:us, {AssociateTag:'tag', "OfferListingId.1": "B00WR23X5I", "Quantity.1": 1})
|
37
|
+
```
|
38
|
+
The only thing it will validate, is a presence of locale. All other parameters will be converted without any verification. So be carefull
|
39
|
+
|
40
|
+
### Builder
|
41
|
+
Library also offers a slightly simpler interface that tries to valide data.
|
42
|
+
|
43
|
+
```
|
44
|
+
items = [
|
45
|
+
{OfferListingId: '123123'}.
|
46
|
+
{ASIN: '1231234', quantity: 2}
|
47
|
+
]
|
48
|
+
|
49
|
+
Carriage.build(items, tag: 'my_attribution_tag', locale: :uk)
|
50
|
+
```
|
51
|
+
* Every item should be a hash, with `ASIN` or `OfferListingId` keys provided. By default quantity is 1.
|
52
|
+
* Carriage.build also requires `:tag` attribute and defaults to `locale: :us` if nothing else was provided.
|
31
53
|
|
32
54
|
## Getting help
|
33
55
|
|
data/lib/carriage/version.rb
CHANGED