Class: Quiz::Worldcup
- Inherits:
-
Object
- Object
- Quiz::Worldcup
- Defined in:
- lib/quiz/world_cup.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#runner_up ⇒ Object
Returns the value of attribute runner_up.
-
#thirth_place ⇒ Object
Returns the value of attribute thirth_place.
-
#winner ⇒ Object
Returns the value of attribute winner.
-
#year ⇒ Object
Returns the value of attribute year.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file) ⇒ Worldcup
constructor
A new instance of Worldcup.
Constructor Details
#initialize(file) ⇒ Worldcup
Returns a new instance of Worldcup.
4 5 6 7 8 |
# File 'lib/quiz/world_cup.rb', line 4 def initialize(file) @@all << self file.each{|key,value| self.send("#{key}=", value)} end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
2 3 4 |
# File 'lib/quiz/world_cup.rb', line 2 def host @host end |
#runner_up ⇒ Object
Returns the value of attribute runner_up.
2 3 4 |
# File 'lib/quiz/world_cup.rb', line 2 def runner_up @runner_up end |
#thirth_place ⇒ Object
Returns the value of attribute thirth_place.
2 3 4 |
# File 'lib/quiz/world_cup.rb', line 2 def thirth_place @thirth_place end |
#winner ⇒ Object
Returns the value of attribute winner.
2 3 4 |
# File 'lib/quiz/world_cup.rb', line 2 def winner @winner end |
#year ⇒ Object
Returns the value of attribute year.
2 3 4 |
# File 'lib/quiz/world_cup.rb', line 2 def year @year end |
Class Method Details
.all ⇒ Object
13 14 15 |
# File 'lib/quiz/world_cup.rb', line 13 def self.all @@all end |
.world_cup_file(file) ⇒ Object
10 11 12 |
# File 'lib/quiz/world_cup.rb', line 10 def self.world_cup_file(file) file.each{|e|Quiz::Worldcup.new(e)} end |