Class: UserCard
Overview
This class converts user input into a Card-like object
Constant Summary collapse
- @@num =
{King: "King", K: "King", Ace: "Ace", A: "Ace", Queen: "Queen", Q: "Queen", Jack: "Jack", J: "Jack", Joker: "Joker", "$".to_sym => "Joker"}
Instance Attribute Summary collapse
-
#num ⇒ Object
readonly
Returns the value of attribute num.
Instance Method Summary collapse
- #_num ⇒ Object
-
#initialize(number = "") ⇒ UserCard
constructor
A new instance of UserCard.
Methods inherited from Card
Constructor Details
#initialize(number = "") ⇒ UserCard
Returns a new instance of UserCard.
29 |
# File 'lib/99_game.rb', line 29 def initialize(number=""); @@num.default, @num = number.to_i, @@num[number.capitalize.to_sym]; end |
Instance Attribute Details
#num ⇒ Object (readonly)
Returns the value of attribute num.
26 27 28 |
# File 'lib/99_game.rb', line 26 def num @num end |
Instance Method Details
#_num ⇒ Object
28 |
# File 'lib/99_game.rb', line 28 def _num; @@num; end |