-
Notifications
You must be signed in to change notification settings - Fork 1
Tournaments
Ilya Krukowski edited this page Nov 17, 2022
·
2 revisions
Tournaments endpoint, supports pagination.
Providing pagination data is optional:
tours = client.tournaments itemsPerPage: 2, page: 3
tours[0].name # => 'Бостонское чаепитие'
Provide tournament ID:
tour = client.tournament 7798
tournament.name # => 'Игры доброй воли'
appeals = client.tournament_appeals 7798
appeals[0].questionNumber # => 20
Alternatively:
tour = client.tournament 7798
appeals = tour.appeals
appeals[0].questionNumber # => 20
requests = client.tournament_requests 7798
requests[0].id # => 101_060
Alternatively:
tour = client.tournament 7798
requests = tour.requests
requests[0].id # => 101_060
results = client.tournament_results 7798, includeTeamMembers: 1, includeMasksAndControversials: 1, includeTeamFlags: 1, includeRatingB: 1, town: 202
results.first.position # => 1
Alternatively:
tour = client.tournament 7798
results = tour.results includeTeamMembers: 1, includeMasksAndControversials: 1, includeTeamFlags: 1, includeRatingB: 1, town: 202
results.first.position # => 1
result = client.create_tournament_result 1, team: "123", position: 2
result.position # => 2
Alternatively:
tournament= client.tournament 7798
tournament.create_result team: "123", position: 2
result = client.update_tournament_result 1, team: "123", position: 3
result.position # => 2
client.delete_tournament_result(1)