Class: Team
- Inherits:
-
Object
- Object
- Team
- Defined in:
- lib/team.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#draws ⇒ Object
readonly
Returns the value of attribute draws.
-
#games_played ⇒ Object
readonly
Returns the value of attribute games_played.
-
#goals_against ⇒ Object
readonly
Returns the value of attribute goals_against.
-
#goals_for ⇒ Object
readonly
Returns the value of attribute goals_for.
-
#losses ⇒ Object
readonly
Returns the value of attribute losses.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#team_name ⇒ Object
readonly
Returns the value of attribute team_name.
-
#wins ⇒ Object
readonly
Returns the value of attribute wins.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(team_name, games_played, wins, losses, draws, points, goals_for, goals_against) ⇒ Team
constructor
A new instance of Team.
Constructor Details
#initialize(team_name, games_played, wins, losses, draws, points, goals_for, goals_against) ⇒ Team
Returns a new instance of Team.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/team.rb', line 7 def initialize(team_name, games_played, wins, losses, draws, points, goals_for, goals_against) @team_name = team_name @games_played = games_played @wins = wins @losses = losses @draws = draws @points = points @goals_for = goals_for @goals_against = goals_against @@all << self end |
Instance Attribute Details
#draws ⇒ Object (readonly)
Returns the value of attribute draws.
4 5 6 |
# File 'lib/team.rb', line 4 def draws @draws end |
#games_played ⇒ Object (readonly)
Returns the value of attribute games_played.
4 5 6 |
# File 'lib/team.rb', line 4 def games_played @games_played end |
#goals_against ⇒ Object (readonly)
Returns the value of attribute goals_against.
4 5 6 |
# File 'lib/team.rb', line 4 def goals_against @goals_against end |
#goals_for ⇒ Object (readonly)
Returns the value of attribute goals_for.
4 5 6 |
# File 'lib/team.rb', line 4 def goals_for @goals_for end |
#losses ⇒ Object (readonly)
Returns the value of attribute losses.
4 5 6 |
# File 'lib/team.rb', line 4 def losses @losses end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
4 5 6 |
# File 'lib/team.rb', line 4 def points @points end |
#team_name ⇒ Object (readonly)
Returns the value of attribute team_name.
4 5 6 |
# File 'lib/team.rb', line 4 def team_name @team_name end |
#wins ⇒ Object (readonly)
Returns the value of attribute wins.
4 5 6 |
# File 'lib/team.rb', line 4 def wins @wins end |
Class Method Details
.all ⇒ Object
19 20 21 |
# File 'lib/team.rb', line 19 def self.all @@all end |