Class: WeatherFunds::Lottery
- Inherits:
-
Object
- Object
- WeatherFunds::Lottery
- Defined in:
- lib/weather_funds/lottery.rb
Defined Under Namespace
Classes: Winner
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
- #<<(winner) ⇒ Object
-
#initialize(name, scheme) ⇒ Lottery
constructor
A new instance of Lottery.
- #winners ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/weather_funds/lottery.rb', line 7 def name @name end |
#scheme ⇒ Object (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 |
#winners ⇒ Object
14 15 16 |
# File 'lib/weather_funds/lottery.rb', line 14 def winners @winners end |