Module: RatingChgkV2::Rest::Players
- Included in:
- RatingChgkV2::Rest
- Defined in:
- lib/rating_chgk_v2/rest/players.rb
Instance Method Summary collapse
- #create_player(params) ⇒ Object
- #delete_player(id) ⇒ Object
- #player(id) ⇒ Object
- #player_seasons(id, params = {}) ⇒ Object
- #player_tournaments(id, params = {}) ⇒ Object
- #players(params = {}) ⇒ Object
- #update_player(id, params) ⇒ Object
Instance Method Details
#create_player(params) ⇒ Object
22 23 24 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 22 def create_player(params) model_load name: 'Player', ep_name: 'Players', ep_params: [[], params], method: :do_post end |
#delete_player(id) ⇒ Object
30 31 32 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 30 def delete_player(id) endpoint('Players', id).do_delete end |
#player(id) ⇒ Object
10 11 12 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 10 def player(id) model_load name: 'Player', ep_name: 'Players', ep_params: id end |
#player_seasons(id, params = {}) ⇒ Object
14 15 16 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 14 def player_seasons(id, params = {}) collection_load name: 'PlayerSeasons', ep_name: 'Players', ep_params: [[id, :seasons], params] end |
#player_tournaments(id, params = {}) ⇒ Object
18 19 20 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 18 def player_tournaments(id, params = {}) collection_load name: 'PlayerTournaments', ep_name: 'Players', ep_params: [[id, :tournaments], params] end |
#players(params = {}) ⇒ Object
6 7 8 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 6 def players(params = {}) collection_load name: 'Players', ep_params: [[], params] end |
#update_player(id, params) ⇒ Object
26 27 28 |
# File 'lib/rating_chgk_v2/rest/players.rb', line 26 def update_player(id, params) model_load name: 'Player', ep_name: 'Players', ep_params: [id, params], method: :do_patch end |