Class: CardDeck::Card

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

Overview

Represents a card in the deck

Instance Method Summary collapse

Instance Method Details

#valueObject

Value of the card



41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/99_game.rb', line 41

def value
	return case @num
		when "Ace" then 1
		when 2..3 then @num
		when 4 then 0
		when 5..8 then @num
		when 9 then 0
		when 10 then 10
		when "Jack" then 0
		when "Queen" then -10
		when "King" then 99
		when "Joker" then 0
	end
end