tagalys 0.0.1 → 0.0.2

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 +13 -69
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 789627b720188896e49bd6eb776097640c3050bb
4
- data.tar.gz: c38f2da30aae1ab0f66603e3b59599fea5c8b1f3
3
+ metadata.gz: c3a55715c02f9b8b4c001a12c737fc0779c943f3
4
+ data.tar.gz: de663097bb0f70b4e7f22c22c0b2c45a14ad6d2b
5
5
  SHA512:
6
- metadata.gz: a8595b6a7f43b4713351c23e205604f08c083e6e74f92d7fc226d5341db0406e5c68b10ccdceb7d6169a2ea460764a723804b16c2b97e34585fbfdeeaa0af73b
7
- data.tar.gz: 8366e14ce86df0e8121587af483f3cb1b69cb022fd0d36d5d06f6360b7b4f6e656416d9450a63e80ce07b4802751a103ccf17977b493ff04690284c5de36b468
6
+ metadata.gz: 4770031f09265df4075ab360c2fdd290073d51592d5a1ad79035f0aa53c7b3997fdc302c7186fc57966fa097f2518b0b6d0f3038ee69789b2ad469fa39bad1f7
7
+ data.tar.gz: 808932c2ff8088adc9ff73a3feca4fc252a1471b8ad4c61378e92bad1d5af2e6acc78162ac7a421cdf3e96473e8b231cdcb20d4ea3152216bba7c5f5b1e553ad
data/lib/tagalys.rb CHANGED
@@ -12,81 +12,17 @@ class Tagalys
12
12
  search_response = request_tagalys('/search', request_body)
13
13
  end
14
14
 
15
- def create_store
15
+ def create_store(currencies, fields, tag_sets, sort_options)
16
16
  request_body = {
17
17
  identification: identification,
18
18
  stores: [
19
19
  {
20
20
  id: "1",
21
21
  label: "Store 1",
22
- currencies: [
23
- {
24
- id: "INR",
25
- label: "₹",
26
- fractional_digits: 2,
27
- rounding_mode: "round",
28
- exchange_rate: 66.77,
29
- default: false
30
- }
31
- ],
32
- fields: [
33
- {
34
- name: "sale_price", # core fields like sku, price, sale_price etc. described in the next section don't have to be defined here, but they can be for the purpose of overriding labels or other options.
35
- type: "float",
36
- label: "Final Price",
37
- currency: true,
38
- filters: true,
39
- search: false
40
- },
41
- {
42
- name: "short_description",
43
- type: "string",
44
- label: "Short Description",
45
- search: true
46
- },
47
- {
48
- name: "name",
49
- type: "string",
50
- label: "Name",
51
- search: true
52
- }
53
- ],
54
- tag_sets: [
55
- {
56
- id: "apparel_type",
57
- label: "Type",
58
- filters: true,
59
- search: true
60
- },
61
- {
62
- id: "color",
63
- label: "Color",
64
- filters: true,
65
- search: true
66
- },
67
- {
68
- id: "gender",
69
- label: "Gender",
70
- filters: true,
71
- search: true
72
- },
73
- {
74
- id: "size",
75
- label: "Size",
76
- filters: true,
77
- search: true
78
- }
79
- ],
80
- sort_options: [
81
- {
82
- field: "name",
83
- label: "Name"
84
- },
85
- {
86
- field: "price",
87
- label: "Price"
88
- }
89
- ],
22
+ currencies: currencies,
23
+ fields: fields,
24
+ tag_sets: tag_sets,
25
+ sort_options: sort_options,
90
26
  locale: "en_US",
91
27
  timezone: "India/Kolkata",
92
28
  multi_currency_mode: "exchange_rate",
@@ -97,6 +33,14 @@ class Tagalys
97
33
  create_response = request_tagalys('/configuration', request_body)
98
34
  end
99
35
 
36
+ def product_sync(link, product_count)
37
+ {
38
+ identification: identification,
39
+ link: link,
40
+ updates_count: product_count
41
+ }
42
+ end
43
+
100
44
  def request_tagalys(path, request_body)
101
45
  uri = URI.parse("https://api-r1.tagalys.com/v1/" + path)
102
46
  header = {'Content-Type': 'application/json'}
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.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anbazhagan Palani
@@ -17,7 +17,7 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/tagalys.rb
20
- homepage: https://rubygems.org/gems/tagalys
20
+ homepage: https://github.com/commutatus/tagalys
21
21
  licenses:
22
22
  - MIT
23
23
  metadata: {}