arctic-vendor 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arctic/vendor/product.rb +12 -12
- data/lib/arctic/vendor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c35888a69388854e55aeb41044e86f0d253bfc641b27c0ccdc8adafdfe11175
|
4
|
+
data.tar.gz: 7e5a474dd62488a6f7c164e5b14a39f2e1497d95d198fac0bd74027f284eaf68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555a66bc09875998d978d5f456ae6d1362a93bdceb7e5cb50d871b8f5e18f9cdd607f9e899523f0c3bb6cce856c88456f0685f13a33361969e5f5c91ec2c49e1
|
7
|
+
data.tar.gz: 287cf6d8345aed3828442774c887e04cda17da8782694eb8f47cd998e612cb6d438e3af430d0e0a03b1d8c48f877e3614fd2869e4cd694814a8c572caa90b212
|
@@ -12,19 +12,16 @@ module Arctic
|
|
12
12
|
end
|
13
13
|
|
14
14
|
attr_reader \
|
15
|
+
:product_hash,
|
15
16
|
:sku,
|
16
17
|
:characteristics,
|
17
18
|
:api,
|
18
19
|
:account_id,
|
19
|
-
:shop_id
|
20
|
-
:state,
|
21
|
-
:master,
|
22
|
-
:price,
|
23
|
-
:currency,
|
24
|
-
:categories,
|
25
|
-
:images
|
20
|
+
:shop_id
|
26
21
|
|
27
22
|
def initialize(account_id, shop_id, product_hash, api_instance)
|
23
|
+
@product_hash = product_hash
|
24
|
+
|
28
25
|
@api = api_instance
|
29
26
|
|
30
27
|
@shop_id = shop_id
|
@@ -32,16 +29,19 @@ module Arctic
|
|
32
29
|
|
33
30
|
@sku = product_hash.fetch 'sku'
|
34
31
|
@characteristics = Characteristics.new product_hash.fetch 'characteristics'
|
35
|
-
|
36
|
-
@categories = product_hash.fetch 'categories', []
|
37
|
-
|
38
|
-
@state = product_hash.fetch 'state'
|
39
|
-
@master = product_hash.fetch 'master'
|
40
32
|
end
|
41
33
|
|
42
34
|
def update_state(state)
|
43
35
|
api.update_product_state account_id, shop_id, sku, state
|
44
36
|
end
|
37
|
+
|
38
|
+
def method_missing(name, *args)
|
39
|
+
if product_hash.stringify_keys.keys.include? name.to_s
|
40
|
+
product_hash.stringify_keys[name.to_s]
|
41
|
+
else
|
42
|
+
super name, *args
|
43
|
+
end
|
44
|
+
end
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arctic-vendor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Kampp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|