Class: TexasHoldem::Combinations::HighestCard

Inherits:
Combination
  • Object
show all
Defined in:
lib/texas-holdem/combinations/highest_card.rb

Constant Summary

Constants inherited from Combination

Combination::MAX_COMBINATION_LENGTH

Instance Attribute Summary

Attributes inherited from Combination

#cards, #cards_by_rank, #cards_by_suit, #combination_cards, #kicker_cards

Instance Method Summary collapse

Methods inherited from Combination

#<=>, #has_combination?, #initialize, #to_s

Constructor Details

This class inherits a constructor from TexasHoldem::Combinations::Combination

Instance Method Details

#compare_same_rank(other) ⇒ Object



8
9
10
# File 'lib/texas-holdem/combinations/highest_card.rb', line 8

def compare_same_rank(other)
  combination_cards[0] <=> other.combination_cards[0]
end

#get_combination_cards(cards) ⇒ Object



4
5
6
# File 'lib/texas-holdem/combinations/highest_card.rb', line 4

def get_combination_cards(cards)
  cards.empty? ? [] : [cards.max]
end