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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4f26913d1335785e3ba6c00834eb856538c1bd0
|
4
|
+
data.tar.gz: e0c7a3c6b70c731c34a2f607a76f641db57a7073
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
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
|