Sha256: 6c0295ef18bdd56ca9f0efa6c144c744027b1d04bd1e0d7b29f7ae0f866a3d88

Contents?: true

Size: 539 Bytes

Versions: 4

Compression:

Stored size: 539 Bytes

Contents

require 'uri'

module Voucherify
  module Service
    class Orders
      attr_reader :client

      def initialize(client)
        @client = client
      end

      def create(order)
        @client.post('/orders', order.to_json)
      end

      def get(order_id)
        @client.get("/orders/#{URI.encode(order_id)}")
      end

      def update(order_id, order)
        @client.put("/orders/#{URI.encode(order_id)}", order.to_json)
      end

      def list(query = {})
        @client.get("/orders", query)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
voucherify-3.0.0 lib/voucherify/service/orders.rb
voucherify-2.4.0 lib/voucherify/service/orders.rb
voucherify-2.3.0 lib/voucherify/service/orders.rb
voucherify-2.2.0 lib/voucherify/service/orders.rb