Sha256: 8be5c9e440e2dbd9bb6a73f222eeb28a6ed581ce28871731973e9a9598e18489
Contents?: true
Size: 610 Bytes
Versions: 13
Compression:
Stored size: 610 Bytes
Contents
require 'uri' module Voucherify module Service class Customers attr_reader :client def initialize(client) @client = client end def create(customer) @client.post('/customers', customer.to_json) end def get(customer_id) @client.get("/customers/#{URI.encode(customer_id)}") end def update(customer) @client.put("/customers/#{URI.encode(customer['id'] || customer[:id])}", customer.to_json) end def delete(customer_id) @client.delete("/customers/#{URI.encode(customer_id)}") end end end end
Version data entries
13 entries across 13 versions & 1 rubygems