Class: ChgkRating::Models::Tournament

Inherits:
Base show all
Defined in:
lib/chgk_rating/models/tournament.rb

Constant Summary

Constants included from Connection

Connection::BASE_URL

Instance Attribute Summary

Attributes inherited from Base

#lazy

Instance Method Summary collapse

Methods inherited from Base

#eager_load!, inherited, #initialize, no_eager_loading!, no_lazy_support!, #to_h

Methods included from Request

#get

Methods included from Connection

#connection

Methods inherited from ChgkObject

#build_model, #extract_id_from

Constructor Details

This class inherits a constructor from ChgkRating::Models::Base

Instance Method Details

#team(team_or_id) ⇒ ChgkRating::Models::TournamentTeam

Returns information about a single TournamentTeam in the current tournament

Parameters:

  • team_or_id (String, Integer or Team)

    Team to search for.

Returns:

Raises:


35
36
37
# File 'lib/chgk_rating/models/tournament.rb', line 35

def team(team_or_id)
  ChgkRating::Models::TournamentTeam.new team_or_id, tournament: self, lazy: true
end

#team_listChgkRating::Collection::Ratings

Returns an array-like TournamentTeams collection specifying which teams participated in the current tournament

Returns:

  • (ChgkRating::Collection::Ratings)

    The collection of teams.


26
27
28
# File 'lib/chgk_rating/models/tournament.rb', line 26

def team_list
  ChgkRating::Collections::TournamentTeams.new tournament: self
end

#team_players(team_or_id) ⇒ ChgkRating::Collection::TournamentPlayers

Returns an array-like TournamentPlayers collection containing roster for a team at the current tournament.

Parameters:

Returns:

  • (ChgkRating::Collection::TournamentPlayers)

    The collection of results.

Raises:


9
10
11
# File 'lib/chgk_rating/models/tournament.rb', line 9

def team_players(team_or_id)
  ChgkRating::Collections::TournamentPlayers.new tournament: self, team: team_or_id
end

#team_results(team_or_id) ⇒ ChgkRating::Collection::TournamentTeamResults

Returns an array-like TournamentTeamResults collection with results for a given team in the current tournament

Parameters:

Returns:

  • (ChgkRating::Collection::TournamentTeamResults)

    The collection of results.

Raises:


19
20
21
# File 'lib/chgk_rating/models/tournament.rb', line 19

def team_results(team_or_id)
  ChgkRating::Collections::TournamentTeamResults.new tournament: self, team: team_or_id
end