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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9b10bccdbda37e0c61b2dbad2920ee98fac213842af037c8891ee00bc284d81
4
- data.tar.gz: 65b338d09027ace93aca485d2f7d59ec360aee4c3fb20be8367886773e2efd94
3
+ metadata.gz: 3c35888a69388854e55aeb41044e86f0d253bfc641b27c0ccdc8adafdfe11175
4
+ data.tar.gz: 7e5a474dd62488a6f7c164e5b14a39f2e1497d95d198fac0bd74027f284eaf68
5
5
  SHA512:
6
- metadata.gz: 8440a5cb2c61d885441bffa66ea4ad2be719ba0dd9576b9cea6f937a9deda4325926cdc3580c00642e580af78fc16c9ce2502efdfdf828d1bb3ec67911df5a2c
7
- data.tar.gz: 4c35c647c5400a98c996a1f3210d94e7b7f277f29902f4f435029daded18cdf2acdb028534c9a742c56d6d6b571e572fd9e5875f702c80bb10f6ac746e798e57
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
@@ -1,5 +1,5 @@
1
1
  module Arctic
2
2
  module Vendor
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  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.3
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-02 00:00:00.000000000 Z
11
+ date: 2018-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake