peddler 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/peddler/service.rb +19 -11
- data/lib/peddler/version.rb +1 -1
- data/test/service_test.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b89bab8ffb0fcd4902068dbcdb8b47917eaed6d4
|
4
|
+
data.tar.gz: 8bfa9a382b50cb908099f69d50fd36d3f530e4dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2062379662693c265f8d0884d92c341156db7303487e87e5ecd805bbefdf0fed425e033345a4965e72e53b75bfc51e5f3791a7ebfaca99b0438c35f04319bfcb
|
7
|
+
data.tar.gz: ae0055bc9d6d0977f73ca479537f38324dead20611dbfb17a259485b7ec7faf279a8dd55839f95539474a1300ee978a6e303a8f06e0521f3f50f769fd83171b2
|
data/lib/peddler/service.rb
CHANGED
@@ -3,19 +3,27 @@ require 'jeff'
|
|
3
3
|
module Peddler
|
4
4
|
# Service is an abstract wrapper around a Marketplace Web Services (MWS)
|
5
5
|
# endpoint.
|
6
|
-
|
7
|
-
# The initializer takes four arguments:
|
8
|
-
#
|
9
|
-
# country - The String ISO 3166-1 two-letter country code of
|
10
|
-
# the base marketplace of the seller.
|
11
|
-
# aws_access_key_id - The String AWS access key id.
|
12
|
-
# aws_secret_access_key - The String AWS secret access key.
|
13
|
-
# seller_id - The String MWS merchant id.
|
14
|
-
#
|
15
|
-
# These arguments are optional and can be set individually later.
|
16
|
-
class Service < Struct.new(:country, :aws_access_key_id, :aws_secret_access_key, :seller_id)
|
6
|
+
class Service
|
17
7
|
include Jeff
|
18
8
|
|
9
|
+
attr_accessor :country, :seller_id
|
10
|
+
|
11
|
+
# The initializer takes four arguments:
|
12
|
+
#
|
13
|
+
# country - The String ISO 3166-1 two-letter country code of
|
14
|
+
# the base marketplace of the seller.
|
15
|
+
# aws_access_key_id - The String AWS access key id.
|
16
|
+
# aws_secret_access_key - The String AWS secret access key.
|
17
|
+
# seller_id - The String MWS merchant id.
|
18
|
+
#
|
19
|
+
# These arguments are optional and can be set individually later.
|
20
|
+
def initialize(country = nil, aws_access_key_id = nil, aws_secret_access_key = nil, seller_id = nil)
|
21
|
+
@country = country
|
22
|
+
@aws_access_key_id = aws_access_key_id
|
23
|
+
@aws_secret_access_key = aws_secret_access_key
|
24
|
+
@seller_id = seller_id
|
25
|
+
end
|
26
|
+
|
19
27
|
# A list of MWS hosts.
|
20
28
|
HOSTS = {
|
21
29
|
'CA' => 'mws.amazonservices.ca',
|
data/lib/peddler/version.rb
CHANGED
data/test/service_test.rb
CHANGED
@@ -31,4 +31,12 @@ class ServiceTest < MiniTest::Test
|
|
31
31
|
def test_defines_constants_on_service
|
32
32
|
refute_nil @klass.const_get(:HOSTS)
|
33
33
|
end
|
34
|
+
|
35
|
+
def test_has_a_key
|
36
|
+
refute_nil @service.aws_access_key_id
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_has_a_secret
|
40
|
+
refute_nil @service.aws_secret_access_key
|
41
|
+
end
|
34
42
|
end
|