Skip to content

Commit 23a015d

Browse files
Change documentation for maxDays and minDays
1 parent ec27839 commit 23a015d

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

lib/beyond_api/resources/products.rb

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# frozen_string_literal: true
22

3-
require "beyond_api/utils"
3+
require 'beyond_api/utils'
44

55
module BeyondApi
6-
autoload :ProductAttachments, "beyond_api/resources/products/attachments"
7-
autoload :ProductAvailability, "beyond_api/resources/products/availability"
8-
autoload :ProductCrossSells, "beyond_api/resources/products/cross_sells"
9-
autoload :ProductCustomAttributes, "beyond_api/resources/products/custom_attributes"
10-
autoload :ProductImages, "beyond_api/resources/products/images"
11-
autoload :ProductSearches, "beyond_api/resources/products/searches"
12-
autoload :ProductVariationProperties, "beyond_api/resources/products/variation_properties"
13-
autoload :ProductVideos, "beyond_api/resources/products/videos"
6+
autoload :ProductAttachments, 'beyond_api/resources/products/attachments'
7+
autoload :ProductAvailability, 'beyond_api/resources/products/availability'
8+
autoload :ProductCrossSells, 'beyond_api/resources/products/cross_sells'
9+
autoload :ProductCustomAttributes, 'beyond_api/resources/products/custom_attributes'
10+
autoload :ProductImages, 'beyond_api/resources/products/images'
11+
autoload :ProductSearches, 'beyond_api/resources/products/searches'
12+
autoload :ProductVariationProperties, 'beyond_api/resources/products/variation_properties'
13+
autoload :ProductVideos, 'beyond_api/resources/products/videos'
1414

1515
class Products < Base
1616
include BeyondApi::ProductAttachments
@@ -43,7 +43,7 @@ class Products < Base
4343
# @products = session.products.all(size: 100, page: 0)
4444
#
4545
def all(params = {})
46-
handle_all_request("/products", :products, params)
46+
handle_all_request('/products', :products, params)
4747
end
4848

4949
#
@@ -98,8 +98,8 @@ def all(params = {})
9898
# }
9999
# },
100100
# "shippingPeriod" : {
101-
# "minDays" : 2,
102-
# "maxDays" : 4,
101+
# "min" : 2,
102+
# "max" : 4,
103103
# "displayUnit" : "WEEKS"
104104
# }
105105
# }'
@@ -157,16 +157,16 @@ def all(params = {})
157157
# }
158158
# },
159159
# "shippingPeriod": {
160-
# "minDays": 2,
161-
# "maxDays": 4,
160+
# "min": 2,
161+
# "max": 4,
162162
# "displayUnit": "WEEKS"
163163
# }
164164
# }
165165
#
166166
# @product = session.products.create(body)
167167
#
168168
def create(body)
169-
response, status = BeyondApi::Request.post(@session, "/products", body)
169+
response, status = BeyondApi::Request.post(@session, '/products', body)
170170

171171
handle_response(response, status)
172172
end
@@ -271,13 +271,14 @@ def update(product_id, body)
271271
# session.products.assign_variation_images_differentiator("f205294b-17dc-4f75-8b5e-5df72abb96df", "491fedf4-37a9-4bcf-98b8-cff2f82879b7")
272272
#
273273
def assign_variation_attribute_as_differentiator(product_id, variation_attribute_id)
274-
response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/variation-attributes/#{variation_attribute_id}/make-differentiator")
274+
response, status = BeyondApi::Request.post(@session,
275+
"/products/#{product_id}/variation-attributes/#{variation_attribute_id}/make-differentiator")
275276

276277
handle_response(response, status, respond_with_true: true)
277278
end
278279

279-
alias_method :create_variation, :create
280-
alias_method :find_variation, :find
281-
alias_method :update_variation, :update
280+
alias create_variation create
281+
alias find_variation find
282+
alias update_variation update
282283
end
283284
end

0 commit comments

Comments
 (0)