Module: RatingChgkV2::Rest::Teams

Included in:
RatingChgkV2::Rest
Defined in:
lib/rating_chgk_v2/rest/teams.rb

Instance Method Summary collapse

Instance Method Details

#create_team(params) ⇒ Object



22
23
24
# File 'lib/rating_chgk_v2/rest/teams.rb', line 22

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

#delete_team(id) ⇒ Object



30
31
32
# File 'lib/rating_chgk_v2/rest/teams.rb', line 30

def delete_team(id)
  endpoint('Teams', id).do_delete
end

#team(id) ⇒ Object



10
11
12
# File 'lib/rating_chgk_v2/rest/teams.rb', line 10

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

#team_seasons(id, params = {}) ⇒ Object



14
15
16
# File 'lib/rating_chgk_v2/rest/teams.rb', line 14

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

#team_tournaments(id, params = {}) ⇒ Object



18
19
20
# File 'lib/rating_chgk_v2/rest/teams.rb', line 18

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

#teams(params = {}) ⇒ Object



6
7
8
# File 'lib/rating_chgk_v2/rest/teams.rb', line 6

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

#update_team(id, params) ⇒ Object



26
27
28
# File 'lib/rating_chgk_v2/rest/teams.rb', line 26

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