Class: Quiz::CHAMPIONLEAGUE

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ CHAMPIONLEAGUE

Returns a new instance of CHAMPIONLEAGUE.



4
5
6
7
8
9
# File 'lib/quiz/champion_league.rb', line 4

def initialize(file)
    @@all << self
     file.each{|key,value|
     self.send("#{key}=", value)}
     
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



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

def host
  @host
end

#runner_upObject

Returns the value of attribute runner_up.



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

def runner_up
  @runner_up
end

#scoreObject

Returns the value of attribute score.



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

def score
  @score
end

#winnerObject

Returns the value of attribute winner.



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

def winner
  @winner
end

#yearObject

Returns the value of attribute year.



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

def year
  @year
end

Class Method Details

.allObject



13
14
15
# File 'lib/quiz/champion_league.rb', line 13

def self.all
    @@all
end

.champion_league_files(file) ⇒ Object



10
11
12
# File 'lib/quiz/champion_league.rb', line 10

def self.champion_league_files(file)
    file.each{|e|Quiz::CHAMPIONLEAGUE.new(e)}  
end