Class: Team

Inherits:
Object
  • Object
show all
Defined in:
lib/team.rb

Constant Summary collapse

@@teams =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/team.rb', line 2

def name
  @name
end

#playedObject

Returns the value of attribute played.



2
3
4
# File 'lib/team.rb', line 2

def played
  @played
end

#pointsObject

Returns the value of attribute points.



2
3
4
# File 'lib/team.rb', line 2

def points
  @points
end

#positionObject

Returns the value of attribute position.



2
3
4
# File 'lib/team.rb', line 2

def position
  @position
end

Class Method Details

.allObject



14
15
16
# File 'lib/team.rb', line 14

def self.all
  @@teams
end