Class: Pot
- Inherits:
-
Object
- Object
- Pot
- Defined in:
- lib/rora/model/pot.rb
Overview
The sum of money that players wager during a single hand or game.
Instance Attribute Summary collapse
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #add(bet) ⇒ Object
-
#initialize ⇒ Pot
constructor
A new instance of Pot.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Pot
Returns a new instance of Pot.
8 9 10 |
# File 'lib/rora/model/pot.rb', line 8 def initialize @total = 0 end |
Instance Attribute Details
#total ⇒ Object (readonly)
Returns the value of attribute total.
6 7 8 |
# File 'lib/rora/model/pot.rb', line 6 def total @total end |
Instance Method Details
#add(bet) ⇒ Object
12 13 14 15 |
# File 'lib/rora/model/pot.rb', line 12 def add bet @total += bet self end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/rora/model/pot.rb', line 17 def to_s "Pot: " + sprintf("$%.02f" , @total) end |