class ChgkRating::Models::Team
Public Instance Methods
Returns TournamentTeam
for the current Team
at a given tournament
@raise [ChgkRating::Error::NotFound] Error
raised when the requested Tournament
cannot be found. @return [ChgkRating::Models::TournamentTeam] The requested TournamentTeam
. @param tournament_or_id [String, Integer or Tournament] Tournament
to load the team for
# File lib/chgk_rating/models/team.rb, line 18 def at_tournament(tournament_or_id) ChgkRating::Models::TournamentTeam.new self, tournament: tournament_or_id, lazy: true end
Returns Rating
for the current Team
in a given release
@return [ChgkRating::Models::Rating] The requested Rating
. @param release_id [String or Integer] Release to load rating for.
# File lib/chgk_rating/models/team.rb, line 26 def rating(release_id) ChgkRating::Models::Rating.new release_id, team: self end
Returns an array-like Ratings collection for the current team.
@return [ChgkRating::Collection::Ratings] The collection of ratings.
# File lib/chgk_rating/models/team.rb, line 33 def ratings ChgkRating::Collections::Ratings.new team: self end
Returns a single Recap
for the current Team
at a given season
@raise [ChgkRating::Error::BadRequest] Error
raised when the requested season is invalid @return [ChgkRating::Models::Recap] The requested Recap
. @param season_id [String or Integer] Season to load recap for.
# File lib/chgk_rating/models/team.rb, line 9 def recap(season_id) ChgkRating::Models::Recap.new season_id, team: self end
Returns an hash-like Recaps collection for the current team, grouped by seasons. Seasons act as keys, whereas Recap
models - as values.
@return [ChgkRating::Collection::Recaps] The collection of recaps.
# File lib/chgk_rating/models/team.rb, line 41 def recaps ChgkRating::Collections::Recaps.new team: self end
Returns a collection of Tournaments that the current team participated at based on the given criteria
@raise [ChgkRating::Error::NotFound] Error
raised when nothing can be found based on the given criteria. @return [ChgkRating::Collection::Tournaments] The collection of tournaments. @param season_id [String or Integer] Season to load tournaments for @option params [String or Integer] :page The requested page. Default is 1
# File lib/chgk_rating/models/team.rb, line 51 def tournaments(season_id: nil, params: {}) ChgkRating::Collections::Tournaments.new params.merge team: self, season_id: season_id, lazy: true end
Private Instance Methods
# File lib/chgk_rating/models/team.rb, line 57 def api_path 'teams' end