Sha256: 0430c5fe2a73539ca8a8ba13cf9a28dbf306c135493f7725f8cfe1f6b6e6fdaa

Contents?: true

Size: 994 Bytes

Versions: 3

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

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

      def team(id)
        model_load name: 'Team', ep_name: 'Teams', ep_params: id
      end

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

      def team_tournaments(id, params = {})
        collection_load name: 'TeamTournaments', ep_name: 'Teams', ep_params: [[id, :tournaments], params]
      end

      def create_team(params)
        model_load name: 'Team', ep_name: 'Teams', ep_params: [[], params], method: :do_post
      end

      def update_team(id, params)
        model_load name: 'Team', ep_name: 'Teams', ep_params: [id, params], method: :do_put
      end

      def delete_team(id)
        endpoint('Teams', 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/teams.rb
rating-chgk-v2-1.4.0 lib/rating_chgk_v2/rest/teams.rb
rating-chgk-v2-1.3.0 lib/rating_chgk_v2/rest/teams.rb