Sha256: 1326e4a31e995e7fbf1670ec97fd64bc6f42261c2abd1c57a00662e2addb5af0

Contents?: true

Size: 694 Bytes

Versions: 6

Compression:

Stored size: 694 Bytes

Contents

require 'cgi'

module Rimu
  class RimuAPI::Orders < Rimu::RimuAPI
      def orders(params={})
          raise ArgumentError, "params should be a hash" unless params.is_a?(Hash)
          default_params = {
              :include_inactive => 'N',
              :server_type => 'VPS',
          }
          filters = prep_data(default_params, params)
          path = "/r/orders;" + filters.collect {|k,v| "#{k}=#{CGI::escape(v.to_s)}"}.join(';')
          send_request(path, "about_orders")
      end

      def order(oid)
          raise ArgumentError, "oid should be an Integer" unless oid.is_a?(Integer)
          send_request("/r/orders/order-#{oid}-dn", "about_order")
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rimu-0.1.0 lib/rimu/orders.rb
rimu-0.0.9 lib/rimu/orders.rb
rimu-0.0.8 lib/rimu/orders.rb
rimu-0.0.7 lib/rimu/orders.rb
rimu-0.0.6 lib/rimu/orders.rb
rimu-0.0.5 lib/rimu/orders.rb