Class: Shirtsio::Product

Inherits:
APIResource show all
Defined in:
lib/shirtsio/product.rb

Instance Attribute Summary

Attributes inherited from ShirtsioObject

#api_key

Class Method Summary collapse

Methods inherited from APIResource

class_name, #refresh, retrieve, url, #url

Methods inherited from ShirtsioObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Shirtsio::ShirtsioObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Shirtsio::ShirtsioObject

Class Method Details

.get_product(params = {}) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/shirtsio/product.rb', line 15

def Product.get_product(params={})
  product_id = params[:product_id]
  get_product_url = @products_url + product_id + "/"
  response, api_key = Shirtsio.request(:get, get_product_url, @api_key, params={})
  Util.convert_to_shirtsio_object(response, api_key)
  response
end

.inventory_count(params = {}) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/shirtsio/product.rb', line 23

def Product.inventory_count(params={})
  product_id = params.delete(:product_id)
  get_product_url = @products_url + product_id + "/"
  response, api_key = Shirtsio.request(:get, get_product_url, @api_key, params)
  #Util.convert_to_shirtsio_object(response, api_key)
  response
end

.list_products(params = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/shirtsio/product.rb', line 7

def Product.list_products(params={})
  category_id = params[:category_id]
  list_products_url = @category_url + category_id + "/"
  response, api_key = Shirtsio.request(:get, list_products_url, @api_key, params={})
  Util.convert_to_shirtsio_object(response, api_key)
  response
end