tagalys 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tagalys.rb +26 -14
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aca4f34518d061daf5b2df472ec717ca8a393e9fdff3a559893d645d27e9ce3a
4
- data.tar.gz: 4a690435364ad892ebc8fe6e1858fc1639eafdbf660dd7ffa56e91875456fba4
3
+ metadata.gz: f7b706aafd40ed781d319434c30c1354413763a77b171bb9177831101285fb30
4
+ data.tar.gz: 184a2687ce7bd12e408e77716ff396f818f178b2353372df1a7e3ab7b2e3b864
5
5
  SHA512:
6
- metadata.gz: ab9e31992a479a1ef6240efa92a41939b89d21b4ceb5787d8dbd9a7328f34395165c7cd86cf61d60e3c084c71400ce5ee13a4374beb8d17c4d5ab2b1d7f02777
7
- data.tar.gz: 16308217a6afffae2106737fb73acf54c886ffc3ecd0eaddb5da871af8aa647701a5954ac2dd2cc2d76d4e99a617612ff0393e3a784a9a501d97cff870e18fa1
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
- "total",
34
- "results",
33
+ "banners",
35
34
  "details",
36
- "sort_options",
37
35
  "filters",
38
- "variables",
39
- "banners"
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
- qf: filters,
49
+ f: filters,
50
50
  page: page,
51
51
  per_page: per_page,
52
52
  request: [
53
- "total",
54
- "results",
53
+ "banners",
55
54
  "details",
56
- "sort_options",
57
55
  "filters",
58
- "variables",
59
- "banners"
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,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tagalys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anbazhagan Palani