Class: PokerHands::HighCard

Inherits:
PokerHand show all
Defined in:
lib/deck_of_cards_handler/poker_hands/high_card.rb

Constant Summary

Constants inherited from PokerHand

PokerHand::HANDS

Instance Attribute Summary

Attributes inherited from PokerHand

#cards

Instance Method Summary collapse

Methods inherited from PokerHand

build_from_string, create, #initialize

Constructor Details

This class inherits a constructor from PokerHands::PokerHand

Instance Method Details

#<=>(other) ⇒ Object



12
13
14
15
16
# File 'lib/deck_of_cards_handler/poker_hands/high_card.rb', line 12

def <=>(other)
  return rank <=> other.rank if self.class != other.class

  sum_cards_ranks(cards) <=> sum_cards_ranks(other.cards)
end

#rankObject



7
8
9
# File 'lib/deck_of_cards_handler/poker_hands/high_card.rb', line 7

def rank
  1
end