Class: TwentyOne::AceCard

Inherits:
FaceCard show all
Defined in:
lib/twenty_one/ace_card.rb

Constant Summary collapse

@@LOWER_VALUE =
1
@@UPPER_VALUE =
11

Instance Attribute Summary

Attributes inherited from FaceCard

#name

Attributes inherited from Card

#suit, #value

Instance Method Summary collapse

Methods inherited from FaceCard

#to_s

Methods inherited from Card

#to_s

Constructor Details

#initialize(suit) ⇒ AceCard

Returns a new instance of AceCard.



8
9
10
11
# File 'lib/twenty_one/ace_card.rb', line 8

def initialize(suit)
	super suit, :ace
	@value = @@LOWER_VALUE
end

Instance Method Details

#use_lowerObject



17
18
19
# File 'lib/twenty_one/ace_card.rb', line 17

def use_lower
	@value = @@LOWER_VALUE
end

#use_upperObject



13
14
15
# File 'lib/twenty_one/ace_card.rb', line 13

def use_upper
	@value = @@UPPER_VALUE
end