Sha256: 29ad56a6bbda475d45a610447fe670274439463de092bdfd49e03c4926514a56

Contents?: true

Size: 666 Bytes

Versions: 29

Compression:

Stored size: 666 Bytes

Contents

module QuizApiClient::Services
  class QuizSessionService < BaseApiService
    def update(params:, token: nil)
      patch_to_quiz_api(params: params, token: token)
    end

    def show(params:, token: nil)
      raise 'Quiz Session Id Required' unless params && params[:id]

      get_from_quiz_api(params: params, token: token)
    end

    private

    def patch_to_quiz_api(params:, token:)
      client(token: token).patch(
        "/api/quiz_sessions/#{params[:id]}",
        quiz_session: params
      )
    end

    def get_from_quiz_api(params:, token:)
      client(token: token).get(
        "/api/quiz_sessions/#{params[:id]}"
      )
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
quiz_api_client-4.13.3 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.13.2 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.13.1 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.13.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.12.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.11.1 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.11.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.10.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.9.1 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.9.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.8.1 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.8.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.7.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.6.0 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.5 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.4 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.3 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.2 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.1 lib/quiz_api_client/services/quiz_session_service.rb
quiz_api_client-4.5.0 lib/quiz_api_client/services/quiz_session_service.rb