Skip to content

Instantly share code, notes, and snippets.

View GemsForBreakFast's full-sized avatar
💎
Learning Ruby

GemsForBreakFast

💎
Learning Ruby
View GitHub Profile
# A playing card.
class Card
# All possible suits a card can have
SUITS = %w(Clubs Diamonds Hearts Spades).freeze
# All possible ranks a card can have
RANKS = %w(2 3 4 5 6 7 8 9 10 Jack Queen King Ace).freeze
# Allows us to do `some_card.rank` and `some_card.suit`
attr_reader :rank, :suit