Class: OfcpScoring::Pair
- Inherits:
-
RankedHand
- Object
- RankedHand
- OfcpScoring::Pair
- Defined in:
- lib/ofcp_scoring/pair.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
3 4 5 6 7 8 9 10 |
# File 'lib/ofcp_scoring/pair.rb', line 3 def <=>(other) return super if super if highest_paired_card == other.highest_paired_card compare_ranks(other) else highest_paired_card <=> other.highest_paired_card end end |
#highest_paired_card ⇒ Object
12 13 14 |
# File 'lib/ofcp_scoring/pair.rb', line 12 def highest_paired_card grouped_ranks.map{|card,matches| card if matches.size == 2}.compact.first end |