Class: WeatherFunds::Lottery

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

Defined Under Namespace

Classes: Winner

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, scheme) ⇒ Lottery

Returns a new instance of Lottery.



9
10
11
12
# File 'lib/weather_funds/lottery.rb', line 9

def initialize(name, scheme)
  @name, @scheme = name, scheme
  @winners       = []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#schemeObject (readonly)

Returns the value of attribute scheme.



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

def scheme
  @scheme
end

Instance Method Details

#<<(winner) ⇒ Object



18
19
20
# File 'lib/weather_funds/lottery.rb', line 18

def <<(winner)
  @winners << winner
end

#winnersObject



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

def winners
  @winners
end