Class: Teachable::Order

Inherits:
Base
  • Object
show all
Defined in:
lib/teachable/order.rb

Class Method Summary collapse

Class Method Details

.create(params = {}) ⇒ Object



8
9
10
# File 'lib/teachable/order.rb', line 8

def create(params = {})
  request_post("https://fast-bayou-75985.herokuapp.com/api/orders.json?user_email=#{Teachable.user_email}&user_token=#{Teachable.user_token}", order: { total: params[:total], total_quantity: params[:total_quantity], email: Teachable.user_email, special_instructions: params[:special_instructions] })
end

.destroy(params = {}) ⇒ Object



12
13
14
# File 'lib/teachable/order.rb', line 12

def destroy(params = {})
  request_delete("https://fast-bayou-75985.herokuapp.com/api/orders/#{params[:id]}.json?user_email=#{Teachable.user_email}&user_token=#{Teachable.user_token}")
end

.ordersObject



4
5
6
# File 'lib/teachable/order.rb', line 4

def orders
  request_get("https://fast-bayou-75985.herokuapp.com/api/orders.json?user_email=#{Teachable.user_email}&user_token=#{Teachable.user_token}")
end