Class: Coinbase::Wallet::Checkout

Inherits:
APIObject
  • Object
show all
Defined in:
lib/coinbase/wallet/models/checkout.rb

Instance Method Summary collapse

Methods inherited from APIObject

#format, #initialize, #method_missing, #refresh!, #respond_to_missing?, #update

Constructor Details

This class inherits a constructor from Coinbase::Wallet::APIObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Coinbase::Wallet::APIObject

Instance Method Details

#create_order(params = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/coinbase/wallet/models/checkout.rb', line 11

def create_order(params = {})
  @client.post("#{self['resource_path']}/orders", params) do |resp|
    out = Order.new(self, resp.data)
    yield(out, resp) if block_given?
  end
end

#orders(params = {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/coinbase/wallet/models/checkout.rb', line 4

def orders(params = {})
  @client.get("#{self['resource_path']}/orders", params) do |resp|
    out = resp.data.map { |item| Order.new(self, item) }
    yield(out, resp) if block_given?
  end
end