Sha256: 1b8914f83d4d28003252fa93ca716ed0dac720446242cbe1f9595b6f2999b127

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

# frozen_string_literal: true

module GmanClient
  module Api
    # Orders API
    module Orders
      # Retrieve a single order
      #
      # @param [String] uuid identifies the order
      def order(uuid)
        response = attempt(@retry_attempts) do
          request
            .api
            .v1
            .orders(uuid)
            .get
        end

        response.to_h
      end

      # Retrieves a number of orders
      #
      # @param [Hash] parameters to filter the orders
      def orders(filter_params)
        response = attempt(@retry_attempts) do
          request
            .api
            .v1
            .orders
            .get(params: filter_params)
        end

        response.map(&:to_h)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gman_client-0.4.1 lib/gman_client/api/orders.rb
gman_client-0.4.0 lib/gman_client/api/orders.rb