module QuizApiClient::Services class QuizService < BaseApiService def update(params:, token: nil) patch_to_quiz_api(params: params, token: token) end def show(params:, token: nil) get_from_quiz_api(params: params, token: token) end def destroy(params:, token: nil) delete_from_quiz_api(params: params, token: token) end private def patch_to_quiz_api(params:, token:) client(token: token).patch( "/api/quizzes/#{params[:id]}", quiz: params ) end def get_from_quiz_api(params:, token:) client(token: token).get( "/api/quizzes/#{params[:id]}" ) end def delete_from_quiz_api(params:, token:) client(token: token).delete( "/api/quizzes/#{params[:id]}" ) end end end