class Button::Orders
Public Instance Methods
create(order)
click to toggle source
Creates an order
@param [Hash] order the order to create @return [Button::Response] the API response
# File lib/button/resources/orders.rb, line 26 def create(order) api_post(path, order) end
delete(order_id)
click to toggle source
Deletes an order
@param [String] order_id the order id @return [Button::Response] the API response
# File lib/button/resources/orders.rb, line 45 def delete(order_id) api_delete(path(order_id)) end
get(order_id)
click to toggle source
Gets an order
@param [String] order_id the order id @return [Button::Response] the API response
# File lib/button/resources/orders.rb, line 17 def get(order_id) api_get(path(order_id)) end
path(order_id = nil)
click to toggle source
# File lib/button/resources/orders.rb, line 7 def path(order_id = nil) return "/v1/order/#{order_id}" if order_id '/v1/order' end
update(order_id, order)
click to toggle source
Updates an order
@param [String] order_id the order id @param [Hash] order the order to create @return [Button::Response] the API response
# File lib/button/resources/orders.rb, line 36 def update(order_id, order) api_post(path(order_id), order) end