module PlayerHandDraw
Public Instance Methods
draw(index)
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 4 def draw(index) out = String.new(' ') out << draw_cards out << draw_money(index) out << draw_status out << "\n\n" out end
draw_cards()
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 44 def draw_cards out = String.new('') out << cards.map { |card| "#{card} " }.join out << ' ⇒ ' << value(SOFT).to_s << ' ' out end
draw_lost_str()
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 26 def draw_lost_str busted? ? 'Busted!' : 'Lose!' end
draw_money(index)
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 34 def draw_money(index) out = String.new('') out << '-' if status == LOST out << '+' if status == WON out << '$' << Format.money(bet / 100.0) out << ' ⇐' if !played && index == blackjack.current_hand out << ' ' out end
draw_status()
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 13 def draw_status case status when LOST draw_lost_str when WON draw_won_str when PUSH 'Push' else '' end end
draw_won_str()
click to toggle source
# File lib/blackjack/player_hand_draw.rb, line 30 def draw_won_str blackjack? ? 'Blackjack!' : 'Won!' end