Class: EightySixed::Hand

Inherits:
Object
  • Object
show all
Defined in:
lib/eighty_sixed.rb

Constant Summary collapse

NON_NUMERICS =
%w{ J K Q }

Instance Method Summary collapse

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_totalObject



15
16
17
# File 'lib/eighty_sixed.rb', line 15

def best_total
  @total ||= calculate_total 
end