Sha256: 6eca4c36b98c4cda6da2484a866669fd3649ec4416fe80bee9bbb3bb13a7c361

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

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

      def player(id)
        model_load name: 'Player', ep_name: 'Players', ep_params: id
      end

      def player_seasons(id, params = {})
        collection_load name: 'PlayerSeasons', ep_name: 'Players', ep_params: [[id, :seasons], params]
      end

      def player_tournaments(id, params = {})
        collection_load name: 'PlayerTournaments', ep_name: 'Players', ep_params: [[id, :tournaments], params]
      end

      def create_player(params)
        model_load name: 'Player', ep_name: 'Players', ep_params: [[], params], method: :do_post
      end

      def update_player(id, params)
        model_load name: 'Player', ep_name: 'Players', ep_params: [id, params], method: :do_put
      end

      def delete_player(id)
        endpoint('Players', id).do_delete
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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