Class: Card
- Inherits:
-
Object
- Object
- Card
- Defined in:
- lib/deck.rb
Instance Attribute Summary collapse
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#suit ⇒ Object
readonly
Returns the value of attribute suit.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(rank, value, suit) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(rank, value, suit) ⇒ Card
Returns a new instance of Card.
27 28 29 30 31 |
# File 'lib/deck.rb', line 27 def initialize(rank, value, suit) @value = value @rank = rank @suit = suit end |
Instance Attribute Details
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
25 26 27 |
# File 'lib/deck.rb', line 25 def rank @rank end |
#suit ⇒ Object (readonly)
Returns the value of attribute suit.
25 26 27 |
# File 'lib/deck.rb', line 25 def suit @suit end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
25 26 27 |
# File 'lib/deck.rb', line 25 def value @value end |