shopikon_import_io_connector 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: 5ed99c471e455796aadf5d7a5ae917118b518846
4
- data.tar.gz: 84b7f918912fb65fb80c2950e7c13c5853603c16
3
+ metadata.gz: f4f26913d1335785e3ba6c00834eb856538c1bd0
4
+ data.tar.gz: e0c7a3c6b70c731c34a2f607a76f641db57a7073
5
5
  SHA512:
6
- metadata.gz: 8a38ba6d072af9407c2ce50d320b594e6ebb6490f4ecfe5d4df6f9aeeb9e02fb0267ab1610ad28e54ed5b1d3074b0eaf7d609af9f03d7eef0cc99350bf61d9fd
7
- data.tar.gz: 8b0b5d9f40a3c2469bf92109db62d5d97e4364c5f9deaf010bf93118e24887ffbce99dd89b68700717b7334b0db3b3566ec1b6be3106a14b9a763e513d436f26
6
+ metadata.gz: 38fcbcdabe3d8903c0fa0d75503747b3e0b9ded7d843ed067f7a8af5ebb93d64884accc3d0a45cc72d4524f8bd9be28b817bf4bd7f43c6d3f7a35f168830657f
7
+ data.tar.gz: e92833dcb8912afa78333a17e1d985a3f8da44b7f6c0f7b5bbffe280a917ef19ee77eb0d7fec8b3e8aaec9f52956f85b4cc6c82c6334acda772c82f24b83721e
@@ -1,6 +1,7 @@
1
1
  class ImportioResponsePresenter
2
2
 
3
3
  def initialize(data, website)
4
+ @website = website
4
5
  craw_cat = data["category"] || ""
5
6
  @crawled_subcategory_name = craw_cat.is_a?(Array) ? craw_cat[0]:craw_cat
6
7
  name_candidate = data["name"] || ""
@@ -16,9 +17,11 @@ class ImportioResponsePresenter
16
17
  image_candidate = data["image"] || ""
17
18
  end
18
19
  @image = image_candidate.is_a?(Array) ? image_candidate[0]:image_candidate
19
- @url = website.url
20
- @web_store_id = website.web_store_id
21
- @website_id = website.id
20
+ if website.present?
21
+ @url = website.url
22
+ @web_store_id = website.web_store_id
23
+ @website_id = website.id
24
+ end
22
25
  end
23
26
 
24
27
  def full_hash
@@ -28,12 +31,16 @@ class ImportioResponsePresenter
28
31
  price: @price,
29
32
  currency: @currency,
30
33
  description: @description,
31
- url: @url,
32
- image: @image,
33
- website_id: @website_id,
34
- web_store_id: @web_store_id
34
+ image: @image
35
35
  }
36
36
 
37
+ if @website.present?
38
+ options.merge!({url: @url,
39
+ website_id: @website_id,
40
+ web_store_id: @web_store_id
41
+ })
42
+ end
43
+
37
44
  options
38
45
  end
39
46
 
@@ -42,7 +49,7 @@ class ImportioResponsePresenter
42
49
  name: @name,
43
50
  url: @url,
44
51
  price: @price,
45
- web_store_id: @web_store_id,
52
+ web_store_id: @web_store_id
46
53
  }
47
54
 
48
55
  options
@@ -1,3 +1,3 @@
1
1
  module ShopikonImportIoConnector
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopikon_import_io_connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Sobolewski