Class: PokerHands::StraightFlush
- Defined in:
- lib/deck_of_cards_handler/poker_hands/straight_flush.rb
Constant Summary
Constants inherited from PokerHand
Instance Attribute Summary
Attributes inherited from PokerHand
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from PokerHand
build_from_string, create, #initialize
Constructor Details
This class inherits a constructor from PokerHands::PokerHand
Class Method Details
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/deck_of_cards_handler/poker_hands/straight_flush.rb', line 19 def <=>(other) return rank <=> other.rank unless instance_of?(other.class) c1 = cards.map { card_value(_1) } c2 = other.cards.map { other.card_value(_1) } c1 <=> c2 end |
#rank ⇒ Object
14 15 16 |
# File 'lib/deck_of_cards_handler/poker_hands/straight_flush.rb', line 14 def rank 9 end |