beyond_api 0.4.0.pre → 0.5.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3795859a890e583f269eb293d62e8e05eb37b03d64c6a0c3b50015c519ae3ef
4
- data.tar.gz: 7e20846e047c5f9cdce44bfe8960ee58c712690f6ac08ffcc13a15165ce4e6d3
3
+ metadata.gz: 9f5722d39666c38bb6841935cb63bd8da7d2df05e511b83091f000f7733385ab
4
+ data.tar.gz: 6e2a20dc312c23b53ba5b8bce7cb43ac19ac1e821cbf04a9ba98aa7316838f22
5
5
  SHA512:
6
- metadata.gz: fd8ad25f6dc6e0026172bd64ba6e952cfb44183aea2547c5bd5ba94a3a1b23b1c358d9f551f1d35ca49fdffdd9e921f3cc13e9fa3189b1fe79e8fa7a3da1a7a3
7
- data.tar.gz: 5ee088be3e778a21cc2db512e7d85b93585cc9b5463731aa29e6a2feca0fc82421cbcd136377c06cfb482d012f136485883c5e38490a1ab74d63d671bf72ce0f
6
+ metadata.gz: bb2dd3dd349cc524ba03258c92bb21798fc47a72d164791acde044afb113480f2799823eea1491f8c903ef6e81c408630330e554a8e79fc3b1163b04358406b4
7
+ data.tar.gz: 691bb06fdf8bb6d7e25dd46054ee41d0f66cac08356ce2bb36ccc368f3e55092f1967b8cee9ac6596f7dfe8b2a98cd07f653d58feb26e5216f791d32dc530788
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### v0.5.0.pre
2
+
3
+ * bug-fixes
4
+ * Fix handling of array as request body
5
+ * Include `BeyondApi::ProductAttachments` module into `BeyondApi::Products` class
6
+ * Include `BeyondApi::ProductAvailability` module into `BeyondApi::Products` class
7
+ * Include `BeyondApi::ProductSearches` module into `BeyondApi::Products` class
8
+ * Include `BeyondApi::ProductVariationProperties` module into `BeyondApi::Products` class
9
+ * Include `BeyondApi::VariationAvailability` module into `BeyondApi::Variations` class
10
+
1
11
  ### v0.4.0.pre
2
12
 
3
13
  * bug-fixes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.4.0.pre)
4
+ beyond_api (0.5.0.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
@@ -13,7 +13,7 @@ GEM
13
13
  dotenv (2.7.5)
14
14
  faker (2.4.0)
15
15
  i18n (~> 1.6.0)
16
- faraday (0.17.0)
16
+ faraday (0.17.1)
17
17
  multipart-post (>= 1.2, < 3)
18
18
  i18n (1.6.0)
19
19
  concurrent-ruby (~> 1.0)
@@ -41,3 +41,14 @@ class String
41
41
  string.gsub(/(?:_|(\/))([a-z\d]*)/) { "#{$1}#{$2.capitalize}" }.gsub("/", "::")
42
42
  end
43
43
  end
44
+
45
+ class Array
46
+ def camelize_keys
47
+ map do |elem|
48
+ case elem
49
+ when Hash, Array; elem.camelize_keys
50
+ else; elem
51
+ end
52
+ end
53
+ end
54
+ end
@@ -23,7 +23,7 @@ module BeyondApi
23
23
  request.url(session.api_url + path)
24
24
  request.headers['Authorization'] = "Bearer #{ session.access_token }"
25
25
  request.params = params.to_h.camelize_keys
26
- request.body = body.to_h.camelize_keys.to_json
26
+ request.body = body.camelize_keys.to_json
27
27
  end
28
28
 
29
29
  [response.body.blank? ? nil : JSON.parse(response.body), response.status]
@@ -1,13 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "beyond_api/utils"
4
+ require "beyond_api/resources/products/attachments"
5
+ require "beyond_api/resources/products/availability"
4
6
  require "beyond_api/resources/products/custom_attributes"
5
7
  require "beyond_api/resources/products/images"
8
+ require "beyond_api/resources/products/searches"
9
+ require "beyond_api/resources/products/variation_properties"
6
10
 
7
11
  module BeyondApi
8
12
  class Products < Base
13
+ include BeyondApi::ProductAttachments
14
+ include BeyondApi::ProductAvailability
9
15
  include BeyondApi::ProductCustomAttributes
10
16
  include BeyondApi::ProductImages
17
+ include BeyondApi::ProductSearches
18
+ include BeyondApi::ProductVariationProperties
11
19
  include BeyondApi::Utils
12
20
 
13
21
  #
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "beyond_api/utils"
4
+ require "beyond_api/resources/variations/availability"
4
5
 
5
6
  module BeyondApi
6
7
  class Variations < Base
8
+ include BeyondApi::VariationAvailability
7
9
  include BeyondApi::Utils
8
10
 
9
11
  #
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.4.0.pre".freeze
2
+ VERSION = "0.5.0.pre".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.pre
4
+ version: 0.5.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-11-12 00:00:00.000000000 Z
13
+ date: 2019-11-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler