Class: OfcpScoring::FourOfAKind
- Inherits:
-
RankedHand
- Object
- RankedHand
- OfcpScoring::FourOfAKind
- Defined in:
- lib/ofcp_scoring/four_of_a_kind.rb
Constant Summary
Constants inherited from RankedHand
Instance Method Summary collapse
Methods inherited from RankedHand
#compare_ranks, #grouped_ranks, #initialize, #rank_name, #ranks, #suits
Constructor Details
This class inherits a constructor from OfcpScoring::RankedHand
Instance Method Details
#<=>(other) ⇒ Object
2 3 4 5 |
# File 'lib/ofcp_scoring/four_of_a_kind.rb', line 2 def <=>(other) return super if super highest_quad_card <=> other.highest_quad_card end |
#highest_quad_card ⇒ Object
7 8 9 |
# File 'lib/ofcp_scoring/four_of_a_kind.rb', line 7 def highest_quad_card grouped_ranks.map{|card,matches| card if matches.size == 4}.compact.max end |