Sha256: b0244211f958ffa5bf88fc270caffed91657d81085dd34fb3a53fb256fd6fbf7

Contents?: true

Size: 1.31 KB

Versions: 4

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

module RatingChgkV2
  module Rest
    module Tournaments
      def tournaments(params = {})
        collection_load name: 'Tournaments', ep_params: [[], params]
      end

      def tournament(id)
        model_load name: 'Tournament', ep_name: 'Tournaments', ep_params: id
      end

      def tournament_appeals(id)
        collection_load name: 'TournamentAppeals', ep_name: 'Tournaments', ep_params: [[id, :appeals]]
      end

      def tournament_requests(id)
        collection_load name: 'TournamentRequests', ep_name: 'Tournaments', ep_params: [[id, :requests]]
      end

      def tournament_results(id, params = {})
        collection_load name: 'TournamentResults', ep_name: 'Tournaments', ep_params: [[id, :results], params]
      end

      def create_tournament_result(id, params)
        model_load name: 'TournamentResult', ep_name: 'Tournaments', ep_params: [[id, :results], params],
                   method: :do_post
      end

      def update_tournament_result(id, params)
        model_load name: 'TournamentResult', ep_name: 'Tournaments', ep_params: [[id, :results], params],
                   method: :do_put
      end

      def delete_tournament_result(id)
        endpoint('Tournaments', [id, :results]).do_delete
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rating-chgk-v2-1.6.0 lib/rating_chgk_v2/rest/tournaments.rb
rating-chgk-v2-1.5.0 lib/rating_chgk_v2/rest/tournaments.rb
rating-chgk-v2-1.4.0 lib/rating_chgk_v2/rest/tournaments.rb
rating-chgk-v2-1.3.0 lib/rating_chgk_v2/rest/tournaments.rb