Module: Epages::REST::Categories
Instance Method Summary collapse
-
#assign_products(options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/post-shops-shopid-product-category-assignments.html Same as Epages::REST::Products#‘assign_categories`.
-
#categories(options = {}) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/get-shops-shopid-categories.html.
-
#category(object, options = {}) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/get-shops-shopid-categories-categoryid.html.
-
#create_category(object, options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/post-shops-shopid-categories-categoryid.html The id can be from the root category or to create a subcategory.
- #delete_category(category) ⇒ Object
-
#delete_products(options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/delete-shops-shopid-product-category-assignments.html Same as Epages::REST::Products#‘delete_from_categories`.
- #reorder_subcategories(object, data) ⇒ Object
- #subcategories(object) ⇒ Object
-
#update_category(object, options) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/put-shops-shopid-categories-categoryid.html.
Methods included from Utils
#epages_id, #format_date, #format_dates_options, #parse_legal_info, #parse_links, #parse_price_info, #parse_product_lowest_price, #parse_product_variations, #parse_suggestions_to_products, #parse_variation_object, #parse_variations, #perform_delete_request, #perform_delete_with_object, #perform_get_request, #perform_get_with_key_and_objects, #perform_get_with_object, #perform_get_with_objects, #perform_multipart_post_with_objects, #perform_patch_with_object, #perform_post_request, #perform_post_with_key_and_objects, #perform_post_with_object, #perform_post_with_objects, #perform_put_request, #perform_put_with_object, #perform_request, #perform_request_with_key_and_objects, #perform_request_with_object, #perform_request_with_objects, #process_thread
Instance Method Details
#assign_products(options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/post-shops-shopid-product-category-assignments.html Same as Epages::REST::Products#‘assign_categories`
54 55 56 |
# File 'lib/epages/rest/categories.rb', line 54 def assign_products( = {}) perform_post_request('/product-category-assignments', ) end |
#categories(options = {}) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/get-shops-shopid-categories.html
10 11 12 |
# File 'lib/epages/rest/categories.rb', line 10 def categories( = {}) perform_get_with_objects('/categories', , Epages::Category) end |
#category(object, options = {}) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/get-shops-shopid-categories-categoryid.html
15 16 17 18 |
# File 'lib/epages/rest/categories.rb', line 15 def category(object, = {}) id = epages_id(object) perform_get_with_object("/categories/#{id}", , Epages::Category) end |
#create_category(object, options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/post-shops-shopid-categories-categoryid.html The id can be from the root category or to create a subcategory
22 23 24 25 |
# File 'lib/epages/rest/categories.rb', line 22 def create_category(object, = {}) id = epages_id(object) perform_post_with_object("/categories/#{id}", , Epages::Category) end |
#delete_category(category) ⇒ Object
35 36 37 38 |
# File 'lib/epages/rest/categories.rb', line 35 def delete_category(category) id = epages_id(category) perform_delete_request("/categories/#{id}") end |
#delete_products(options = {}) ⇒ Object
implements the call developer.epages.com/apps/api-reference/delete-shops-shopid-product-category-assignments.html Same as Epages::REST::Products#‘delete_from_categories`
60 61 62 |
# File 'lib/epages/rest/categories.rb', line 60 def delete_products( = {}) perform_delete_request('/product-category-assignments', ) end |
#reorder_subcategories(object, data) ⇒ Object
47 48 49 50 |
# File 'lib/epages/rest/categories.rb', line 47 def reorder_subcategories(object, data) id = epages_id(object) perform_put_request("/categories/#{id}/sequence", data) end |
#subcategories(object) ⇒ Object
41 42 43 44 |
# File 'lib/epages/rest/categories.rb', line 41 def subcategories(object) id = epages_id(object) perform_get_request("/categories/#{id}/sequence") end |
#update_category(object, options) ⇒ Object
implements the calls in developer.epages.com/apps/api-reference/put-shops-shopid-categories-categoryid.html
28 29 30 31 32 |
# File 'lib/epages/rest/categories.rb', line 28 def update_category(object, ) id = epages_id(object) [:categoryId] = id perform_put_with_object("/categories/#{id}", , Epages::Category) end |