Class: CardDeck::Card
- Inherits:
-
Object
- Object
- CardDeck::Card
- Defined in:
- lib/card.rb
Overview
Represents a card in the deck
Instance Method Summary collapse
-
#value ⇒ Object
Value of the card.
Instance Method Details
#value ⇒ Object
Value of the card
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/card.rb', line 4 def value 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 |