Class: Bling::API::Product
Overview
This class is used to make requests to all available actions related to products in Bling api. Is strongly recommended to use the Bling::API module wrapper
Instance Method Summary collapse
-
#create(params) ⇒ [Record]
Insert a product in Bling.
-
#delete(product_id) ⇒ [Record]
Delete a product in Bling.
-
#get(product_id) ⇒ [Record]
Get a specific object based on product_id.
-
#list ⇒ [Record]
Get a list of available products.
-
#update(product_id, params) ⇒ [Record]
Update a product in Bling.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bling::API::Request
Instance Method Details
#create(params) ⇒ [Record]
Insert a product in Bling
63 64 65 66 |
# File 'lib/bling/api/product.rb', line 63 def create(params) @params = params post_request(t_url(:product), parsed_xml) end |
#delete(product_id) ⇒ [Record]
Delete a product in Bling
113 114 115 |
# File 'lib/bling/api/product.rb', line 113 def delete(product_id) delete_request(t_url(:product, product_id)) end |
#get(product_id) ⇒ [Record]
Get a specific object based on product_id
29 30 31 |
# File 'lib/bling/api/product.rb', line 29 def get(product_id) get_request(t_url(:product, product_id)) end |
#list ⇒ [Record]
Get a list of available products
16 17 18 |
# File 'lib/bling/api/product.rb', line 16 def list get_request(t_url(:products)) end |
#update(product_id, params) ⇒ [Record]
Update a product in Bling
99 100 101 102 |
# File 'lib/bling/api/product.rb', line 99 def update(product_id, params) @params = params post_request(t_url(:product, product_id), parsed_xml) end |