module QuizApiClient::Services class QuizSessionsService < BaseApiService def list(params:, token: nil) raise 'Quiz Id Required' unless params && params[:quiz_id] raise 'Quiz Session Ids Required' unless params && params[:ids] client(token: token).get( "/api/quizzes/#{params[:quiz_id]}/quiz_sessions", query: params[:ids].to_query('ids') ) end def create(params:, token: nil) raise 'Quiz Id Required' unless params && params[:quiz_id] post_to_quiz_api(params: params, token: token) end private def post_to_quiz_api(params:, token:) client(token: token).post( "/api/quizzes/#{params[:quiz_id]}/quiz_sessions", quiz_session: params ) end end end