Class: Worldcup::Team

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#coachObject (readonly)

Returns the value of attribute coach.



7
8
9
# File 'lib/worldcup.rb', line 7

def coach
  @coach
end

#countryObject (readonly)

Returns the value of attribute country.



6
7
8
# File 'lib/worldcup.rb', line 6

def country
  @country
end

#groupObject (readonly)

Returns the value of attribute group.



8
9
10
# File 'lib/worldcup.rb', line 8

def group
  @group
end

Class Method Details

.allObject



28
29
30
# File 'lib/worldcup.rb', line 28

def self.all
  @teams.values
end

.find(name) ⇒ Object

Raises:

  • (RuntimeError)


32
33
34
35
36
37
38
# File 'lib/worldcup.rb', line 32

def self.find(name)
  result = @teams[name.downcase]

  raise(RuntimeError, "No team found for lookup '#{name}'") unless result

  result
end