Class: Dealer
- Inherits:
-
Object
- Object
- Dealer
- Defined in:
- lib/dealer.rb
Instance Attribute Summary collapse
-
#deck ⇒ Object
Returns the value of attribute deck.
-
#hand ⇒ Object
Returns the value of attribute hand.
Instance Method Summary collapse
- #deal ⇒ Object (also: #river, #turn)
- #deal_to_player(player) ⇒ Object
- #flop ⇒ Object
- #initial_truco ⇒ Object
-
#initialize ⇒ Dealer
constructor
A new instance of Dealer.
Constructor Details
Instance Attribute Details
#deck ⇒ Object
Returns the value of attribute deck.
3 4 5 |
# File 'lib/dealer.rb', line 3 def deck @deck end |
#hand ⇒ Object
Returns the value of attribute hand.
3 4 5 |
# File 'lib/dealer.rb', line 3 def hand @hand end |
Instance Method Details
#deal ⇒ Object Also known as: river, turn
27 28 29 |
# File 'lib/dealer.rb', line 27 def deal @hand.cards << @deck.cards.pop end |
#deal_to_player(player) ⇒ Object
10 11 12 |
# File 'lib/dealer.rb', line 10 def deal_to_player(player) player.cards << @deck.cards.pop end |
#flop ⇒ Object
14 15 16 |
# File 'lib/dealer.rb', line 14 def flop 3.times{ |n| deal } end |
#initial_truco ⇒ Object
18 19 20 |
# File 'lib/dealer.rb', line 18 def initial_truco 3.times { |n| player.cards << @deck.cards.pop } end |