Class: TwentyOne::AceCard
- Defined in:
- lib/twenty_one/ace_card.rb
Constant Summary collapse
- @@LOWER_VALUE =
1
- @@UPPER_VALUE =
11
Instance Attribute Summary
Attributes inherited from FaceCard
Attributes inherited from Card
Instance Method Summary collapse
-
#initialize(suit) ⇒ AceCard
constructor
A new instance of AceCard.
- #use_lower ⇒ Object
- #use_upper ⇒ Object
Methods inherited from FaceCard
Methods inherited from Card
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_lower ⇒ Object
17 18 19 |
# File 'lib/twenty_one/ace_card.rb', line 17 def use_lower @value = @@LOWER_VALUE end |
#use_upper ⇒ Object
13 14 15 |
# File 'lib/twenty_one/ace_card.rb', line 13 def use_upper @value = @@UPPER_VALUE end |