class Voucherify::Service::Orders
Attributes
client[R]
Public Class Methods
new(client)
click to toggle source
# File lib/voucherify/service/orders.rb, line 8 def initialize(client) @client = client end
Public Instance Methods
create(order)
click to toggle source
# File lib/voucherify/service/orders.rb, line 12 def create(order) @client.post('/orders', order.to_json) end
get(order_id)
click to toggle source
# File lib/voucherify/service/orders.rb, line 16 def get(order_id) @client.get("/orders/#{ERB::Util.url_encode(order_id)}") end
list(query = {})
click to toggle source
# File lib/voucherify/service/orders.rb, line 24 def list(query = {}) @client.get("/orders", query) end
update(order_id, order)
click to toggle source
# File lib/voucherify/service/orders.rb, line 20 def update(order_id, order) @client.put("/orders/#{ERB::Util.url_encode(order_id)}", order.to_json) end