Class: ChgkRating::Models::TournamentTeam
- Inherits:
-
Base
- Object
- ChgkObject
- Base
- ChgkRating::Models::TournamentTeam
- Defined in:
- lib/chgk_rating/models/tournament/tournament_team.rb
Constant Summary
Constants included from Connection
Instance Attribute Summary collapse
-
#team ⇒ Object
readonly
Returns the value of attribute team.
-
#tournament ⇒ Object
readonly
Returns the value of attribute tournament.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(team_or_hash, params = {}) ⇒ TournamentTeam
constructor
A new instance of TournamentTeam.
-
#players ⇒ ChgkRating::Collection::TournamentTeamPlayers
Returns an array-like TournamentTeamPlayers collection containing roster for the current TournamentTeam.
-
#results ⇒ ChgkRating::Collection::TournamentTeamResults
Returns an array-like TournamentTeamResults collection containing results for the current TournamentTeam.
Methods inherited from Base
attribute_mapping, #eager_load!, inherited, no_eager_loading!, no_lazy_support!, #to_h
Methods included from Request
Methods included from Connection
Methods inherited from ChgkObject
#build_model, #extract_id_from
Constructor Details
#initialize(team_or_hash, params = {}) ⇒ TournamentTeam
Returns a new instance of TournamentTeam.
10 11 12 13 14 |
# File 'lib/chgk_rating/models/tournament/tournament_team.rb', line 10 def initialize(team_or_hash, params = {}) @team = build_model team_or_hash @tournament = build_model params[:tournament], ChgkRating::Models::Tournament super extract_id_from(team_or_hash), params end |
Instance Attribute Details
#team ⇒ Object (readonly)
Returns the value of attribute team.
8 9 10 |
# File 'lib/chgk_rating/models/tournament/tournament_team.rb', line 8 def team @team end |
#tournament ⇒ Object (readonly)
Returns the value of attribute tournament.
8 9 10 |
# File 'lib/chgk_rating/models/tournament/tournament_team.rb', line 8 def tournament @tournament end |
Instance Method Details
#players ⇒ ChgkRating::Collection::TournamentTeamPlayers
Returns an array-like TournamentTeamPlayers collection containing roster for the current TournamentTeam
19 20 21 |
# File 'lib/chgk_rating/models/tournament/tournament_team.rb', line 19 def players ChgkRating::Collections::TournamentTeamPlayers.new tournament: @tournament, team: @team end |
#results ⇒ ChgkRating::Collection::TournamentTeamResults
Returns an array-like TournamentTeamResults collection containing results for the current TournamentTeam
26 27 28 |
# File 'lib/chgk_rating/models/tournament/tournament_team.rb', line 26 def results ChgkRating::Collections::TournamentTeamResults.new tournament: @tournament, team: @team end |