Class: Shipwire::Products

Inherits:
Api
  • Object
show all
Defined in:
lib/shipwire/products.rb

Direct Known Subclasses

Base, Insert, Kit, VirtualKit

Defined Under Namespace

Classes: Base, Insert, Kit, VirtualKit

Instance Method Summary collapse

Methods inherited from Api

#request

Instance Method Details

#create(body) ⇒ Object



7
8
9
# File 'lib/shipwire/products.rb', line 7

def create(body)
  request(:post, 'products', body: body_runner(body))
end

#find(id) ⇒ Object



11
12
13
# File 'lib/shipwire/products.rb', line 11

def find(id)
  request(:get, "products/#{id}")
end

#list(params = {}) ⇒ Object



3
4
5
# File 'lib/shipwire/products.rb', line 3

def list(params = {})
  request(:get, 'products', params: params_runner(params))
end

#retire(id) ⇒ Object Also known as: remove, delete



19
20
21
# File 'lib/shipwire/products.rb', line 19

def retire(id)
  request(:post, 'products/retire', body: retire_object(id))
end

#update(id, body) ⇒ Object



15
16
17
# File 'lib/shipwire/products.rb', line 15

def update(id, body)
  request(:put, "products/#{id}", body: body_runner(body))
end