Class: Paystack::Resources::Product

Inherits:
BaseResource show all
Defined in:
lib/paystack/resources/product.rb

Instance Method Summary collapse

Methods inherited from BaseResource

new

Instance Method Details

#create(body = {}) ⇒ Object

Create Product POST /product



10
11
12
# File 'lib/paystack/resources/product.rb', line 10

def create(body = {})
  @transport.post("/product", body: body)
end

#delete(id) ⇒ Object

Delete Product DELETE /product/id



17
18
19
# File 'lib/paystack/resources/product.rb', line 17

def delete(id)
  @transport.delete("/product/#{id}")
end

#fetch(id) ⇒ Object

Fetch Product GET /product/id



24
25
26
# File 'lib/paystack/resources/product.rb', line 24

def fetch(id)
  @transport.get("/product/#{id}")
end

#list(query = {}) ⇒ Object

List Products GET /product



31
32
33
# File 'lib/paystack/resources/product.rb', line 31

def list(query = {})
  @transport.get("/product", query: query)
end

#update(id, body = {}) ⇒ Object

Update product PUT /product/id



38
39
40
# File 'lib/paystack/resources/product.rb', line 38

def update(id, body = {})
  @transport.put("/product/#{id}", body: body)
end