Class: Team
- Inherits:
-
Object
- Object
- Team
- Defined in:
- lib/team.rb
Constant Summary collapse
- @@teams =
[]
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#played ⇒ Object
Returns the value of attribute played.
-
#points ⇒ Object
Returns the value of attribute points.
-
#position ⇒ Object
Returns the value of attribute position.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(info) ⇒ Team
constructor
A new instance of Team.
Constructor Details
#initialize(info) ⇒ Team
Returns a new instance of Team.
6 7 8 9 10 11 12 |
# File 'lib/team.rb', line 6 def initialize(info) @name = info[:name] @played = info[:played] @points = info[:points] @position = info[:position] @@teams << self end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/team.rb', line 2 def name @name end |
#played ⇒ Object
Returns the value of attribute played.
2 3 4 |
# File 'lib/team.rb', line 2 def played @played end |
#points ⇒ Object
Returns the value of attribute points.
2 3 4 |
# File 'lib/team.rb', line 2 def points @points end |
#position ⇒ Object
Returns the value of attribute position.
2 3 4 |
# File 'lib/team.rb', line 2 def position @position end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/team.rb', line 14 def self.all @@teams end |