lib/teachable_api/user.rb
# Lists all the orders currently associated with this user.
#
# Requires authentication.
#
# NOTE: The results are not cached, so each call to this method will 
# involve a network request.
Lists all the orders currently associated with this user.
Requires authentication.

The results are not cached, so each call to this method will
involve a network request.
Lists all the orders currently associated with this user . Requires authentication . The results are not cached so each call to this method will involve a network request .
def orders
      resp = API.connection.get 'api/orders', {
        user_email: @email,
        user_token: @token
      }
      case resp.status
      when 200
        resp.body.map { |order_hash| Order.new(order_hash) }
      when 401
        raise Teachable::AuthError, resp.body['error']
      else
        raise Teachable::Error, 'Unknown response.'
      end
    end
def orders resp = API . connection . get 'api/orders' , { user_email : @email , user_token : @token } case resp . status when 200 resp . body . map { | order_hash | Order . new ( order_hash ) } when 401 raise Teachable :: AuthError , resp . body [ 'error' ] else raise Teachable :: Error , 'Unknown response.' end end
Lists all the orders currently associated with this user.
Lists all the orders currently associated with this user .