Sha256: 1b4d7bb39b566c2c43498d1988c373062a366e6f2d9e780622691bcf44d137f1

Contents?: true

Size: 632 Bytes

Versions: 5

Compression:

Stored size: 632 Bytes

Contents

# encoding: utf-8

module Nimbu
  module Endpoints
    class Orders < Endpoint
      def list(*args)
        arguments(args)

        response = get_request("/orders", arguments.params)
        return response unless block_given?
        response.each { |el| yield el }
      end
      alias :all :list

      def get(*args)
        arguments(args, :required => [:order_id])

        get_request("/orders/#{order_id}", arguments.params)
      end
      alias :find :get

      def count(*args)
        arguments(args)

        get_request("/orders/count", arguments.params)
      end

    end # Orders
  end # Endpoints
end # Nimbu

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
nimbu-api-0.4.4 lib/nimbu-api/endpoints/orders.rb
nimbu-api-0.4.3 lib/nimbu-api/endpoints/orders.rb
nimbu-api-0.4.2 lib/nimbu-api/endpoints/orders.rb
nimbu-api-0.4.1 lib/nimbu-api/endpoints/orders.rb
nimbu-api-0.4.0 lib/nimbu-api/endpoints/orders.rb