tagalys 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tagalys.rb +26 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7b706aafd40ed781d319434c30c1354413763a77b171bb9177831101285fb30
|
4
|
+
data.tar.gz: 184a2687ce7bd12e408e77716ff396f818f178b2353372df1a7e3ab7b2e3b864
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d53c9f5019ce99851c72e4bfc170e308796b8ce43ad8e62963c9d5fea10ad28fa0b2676a87f4aa850aafbb95a56840550f494fe3145730fc2697f782cffcdc04
|
7
|
+
data.tar.gz: 186d264ac59359db48422b5ef3d0c2dfeb69e3b5adb1d9d395998c96c4657bd169857f9d0cb617e9d251047970dca3a1bab008b173475d4c47942498fe7eb9f6
|
data/lib/tagalys.rb
CHANGED
@@ -19,7 +19,7 @@ module Tagalys
|
|
19
19
|
yield(configuration)
|
20
20
|
end
|
21
21
|
|
22
|
-
def search(query=nil, filters=nil, sort=nil, page=1, per_page=30)
|
22
|
+
def search(query = nil, filters = nil, sort = nil, page = 1, per_page = 30)
|
23
23
|
return { status: "Either query or filter should be present" } if query == nil && filters == nil
|
24
24
|
# return { status: "Filter should be a hash" } if filters && filters.class != Hash
|
25
25
|
request_body = {
|
@@ -30,39 +30,39 @@ module Tagalys
|
|
30
30
|
page: page,
|
31
31
|
per_page: per_page,
|
32
32
|
request: [
|
33
|
-
"
|
34
|
-
"results",
|
33
|
+
"banners",
|
35
34
|
"details",
|
36
|
-
"sort_options",
|
37
35
|
"filters",
|
38
|
-
"
|
39
|
-
"
|
36
|
+
"results",
|
37
|
+
"sort_options",
|
38
|
+
"total",
|
39
|
+
"variables"
|
40
40
|
]
|
41
41
|
}.compact
|
42
42
|
search_response = request_tagalys('/search', request_body)
|
43
43
|
end
|
44
44
|
|
45
|
-
def get_page_details(page_name, filters=nil, sort=nil, page=1, per_page=30)
|
45
|
+
def get_page_details(page_name, filters = nil, sort = nil, page = 1, per_page = 30)
|
46
46
|
request_body = {
|
47
47
|
identification: identification,
|
48
48
|
sort: sort,
|
49
|
-
|
49
|
+
f: filters,
|
50
50
|
page: page,
|
51
51
|
per_page: per_page,
|
52
52
|
request: [
|
53
|
-
"
|
54
|
-
"results",
|
53
|
+
"banners",
|
55
54
|
"details",
|
56
|
-
"sort_options",
|
57
55
|
"filters",
|
58
|
-
"
|
59
|
-
"
|
56
|
+
"results",
|
57
|
+
"sort_options",
|
58
|
+
"total",
|
59
|
+
"variables"
|
60
60
|
]
|
61
61
|
}.compact
|
62
62
|
search_response = request_tagalys('/mpages/' + page_name, request_body)
|
63
63
|
end
|
64
64
|
|
65
|
-
def get_page_list(page=1, per_page=30)
|
65
|
+
def get_page_list(page = 1, per_page = 30)
|
66
66
|
request_body = {
|
67
67
|
identification: identification,
|
68
68
|
request: ["url_component", "variables"],
|
@@ -72,6 +72,18 @@ module Tagalys
|
|
72
72
|
search_response = request_tagalys('/mpages/', request_body)
|
73
73
|
end
|
74
74
|
|
75
|
+
def get_similar_products(product_id)
|
76
|
+
request_body = {
|
77
|
+
identification: identification,
|
78
|
+
max_products: 16,
|
79
|
+
request: [
|
80
|
+
"details",
|
81
|
+
"results"
|
82
|
+
]
|
83
|
+
}.compact
|
84
|
+
search_response = request_tagalys("/products/#{product_id}/similar", request_body)
|
85
|
+
end
|
86
|
+
|
75
87
|
def create_store(currencies, fields, tag_sets, sort_options)
|
76
88
|
request_body = {
|
77
89
|
identification: identification,
|