Class: Quiz::BALONDOR

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ BALONDOR

Returns a new instance of BALONDOR.



4
5
6
7
8
# File 'lib/quiz/balon_d_or.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/balon_d_or.rb', line 2

def host
  @host
end

#runner_upObject

Returns the value of attribute runner_up.



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

def runner_up
  @runner_up
end

#winnerObject

Returns the value of attribute winner.



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

def winner
  @winner
end

#yearObject

Returns the value of attribute year.



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

def year
  @year
end

Class Method Details

.allObject



12
13
14
# File 'lib/quiz/balon_d_or.rb', line 12

def self.all
    @@all
end

.balon_d_or(file) ⇒ Object



9
10
11
# File 'lib/quiz/balon_d_or.rb', line 9

def self.balon_d_or(file)
    file.each{|e|Quiz::BALONDOR.new(e)}  
end