Class: EightySixed::Hand
- Inherits:
-
Object
- Object
- EightySixed::Hand
- Defined in:
- lib/eighty_sixed.rb
Constant Summary collapse
- NON_NUMERICS =
%w{ J K Q }
Instance Method Summary collapse
- #best_total ⇒ Object
-
#initialize(cards) ⇒ Hand
constructor
A new instance of Hand.
Constructor Details
#initialize(cards) ⇒ Hand
Returns a new instance of Hand.
9 10 11 12 13 |
# File 'lib/eighty_sixed.rb', line 9 def initialize(cards) @cards = cards @total = nil @aces = 0 end |
Instance Method Details
#best_total ⇒ Object
15 16 17 |
# File 'lib/eighty_sixed.rb', line 15 def best_total @total ||= calculate_total end |