I have a Card
class and I want to overload the >
operator to compare against another card (Ace is higher than king, king higher than queen, etc). I've forgotten what little I ever knew about Ruby and don't have a clue where to start.
class Card
@@RANKS = ['A', 'K', 'Q', 'J', 'T', '9', '8','7','6','5','4','3','2']
attr_reader :rank
def initialize(str)
@rank = str[0,1]
end
def > (other)
#?????
end
end