Class: Pot

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializePot

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

#totalObject (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_sObject



17
18
19
# File 'lib/rora/model/pot.rb', line 17

def to_s
  "Pot: " + sprintf("$%.02f" , @total)
end