Class: Jet::Client::Products

Inherits:
Object
  • Object
show all
Defined in:
lib/jet/client/products.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Products

Returns a new instance of Products.



4
5
6
# File 'lib/jet/client/products.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#get_inventory(merchant_sku) ⇒ Object



12
13
14
# File 'lib/jet/client/products.rb', line 12

def get_inventory(merchant_sku)
  @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/inventory")
end

#get_price(merchant_sku) ⇒ Object



28
29
30
# File 'lib/jet/client/products.rb', line 28

def get_price(merchant_sku)
  @client.rest_get_with_token("/merchant-skus/#{merchant_sku}/price")
end

#get_product(merchant_sku) ⇒ Object



20
21
22
# File 'lib/jet/client/products.rb', line 20

def get_product(merchant_sku)
  @client.rest_get_with_token("/merchant-skus/#{merchant_sku}")
end

#get_products(params = {}) ⇒ Object



36
37
38
# File 'lib/jet/client/products.rb', line 36

def get_products(params = {})
  @client.rest_get_with_token('/merchant-skus', params)
end

#update_image(merchant_sku, body = {}) ⇒ Object



32
33
34
# File 'lib/jet/client/products.rb', line 32

def update_image(merchant_sku, body = {})
  @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/image", body)
end

#update_inventory(merchant_sku, body = {}) ⇒ Object



8
9
10
# File 'lib/jet/client/products.rb', line 8

def update_inventory(merchant_sku, body = {})
  @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/inventory", body)
end

#update_price(merchant_sku, body = {}) ⇒ Object



24
25
26
# File 'lib/jet/client/products.rb', line 24

def update_price(merchant_sku, body = {})
  @client.rest_put_with_token("/merchant-skus/#{merchant_sku}/price", body)
end

#update_product(merchant_sku, body = {}) ⇒ Object



16
17
18
# File 'lib/jet/client/products.rb', line 16

def update_product(merchant_sku, body = {})
  @client.rest_put_with_token("/merchant-skus/#{merchant_sku}", body)
end