Class: ChgkRating::Models::Tournament

Inherits:
Base show all
Defined in:
lib/chgk_rating/models/tournament/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

attribute_mapping, #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_by(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:



37
38
39
# File 'lib/chgk_rating/models/tournament/tournament.rb', line 37

def team_by(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.



28
29
30
# File 'lib/chgk_rating/models/tournament/tournament.rb', line 28

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

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

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

Parameters:

Returns:

  • (ChgkRating::Collection::TournamentTeamPlayers)

    The collection of results.

Raises:



11
12
13
# File 'lib/chgk_rating/models/tournament/tournament.rb', line 11

def team_players(team_or_id)
  ChgkRating::Collections::TournamentTeamPlayers.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:



21
22
23
# File 'lib/chgk_rating/models/tournament/tournament.rb', line 21

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