Sha256: a0ba71d7ab0f792f86bff4a4433129299342da7e80c686d81b50a8e2747bd60a

Contents?: true

Size: 768 Bytes

Versions: 1

Compression:

Stored size: 768 Bytes

Contents

module Base
  module Apis
    class Order
      include HTTP
      attr_reader :client_secret

      def initialize(client_secret)
        @client_secret = client_secret
      end

      def request
        # https://github.com/baseinc/api-docs/blob/master/base_api_v1_orders.md
        #
        # { start_ordered: '2016-01-01',
        #   end_ordered:   '2016-01-10',
        #   limit:         20,
        #   offset:        0 }
        request_parameters = block_given? ? yield : {}

        uri =
          URI([
            API_HOST,
            "/#{API_VERSION}/orders?",
            URI.encode_www_form(request_parameters)].join)

        request = generate_request(uri, client_secret.header_parameter)
        start(request, uri)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
base-api-client-0.2.5.beta lib/base/apis/order.rb