Class: TwentyOne::FaceCard
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Card
Instance Method Summary collapse
-
#initialize(suit, name) ⇒ FaceCard
constructor
A new instance of FaceCard.
- #to_s ⇒ Object
Constructor Details
#initialize(suit, name) ⇒ FaceCard
Returns a new instance of FaceCard.
7 8 9 10 |
# File 'lib/twenty_one/face_card.rb', line 7 def initialize(suit, name) super suit, 10 @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/twenty_one/face_card.rb', line 5 def name @name end |
Instance Method Details
#to_s ⇒ Object
12 13 14 |
# File 'lib/twenty_one/face_card.rb', line 12 def to_s "#{@name} of #{@suit}" end |