Class: TexasHoldem::FullHouse
Constant Summary
collapse
- Pattern =
/^(?:(\d) \1{2} (\d) \2|(\d) \3 (\d) \4{2})/x
Instance Attribute Summary
Attributes inherited from PlayerHand
#cards
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from PlayerHand
#<=>, inherited, #initialize, #remaining_cards, #score
Class Method Details
.create(cards) ⇒ Object
78
79
80
|
# File 'lib/player_hand.rb', line 78
def self.create(cards)
new(cards) if cards.gsub(/\D/,'').split(//).sort.to_s.match Pattern
end
|
Instance Method Details
#base_score ⇒ Object
86
87
88
|
# File 'lib/player_hand.rb', line 86
def base_score
6
end
|
#name ⇒ Object
82
83
84
|
# File 'lib/player_hand.rb', line 82
def name
'full house'
end
|
#relative_score ⇒ Object
90
91
92
|
# File 'lib/player_hand.rb', line 90
def relative_score
@cards[ TexasHoldem::ThreeOfAKind::Pattern, 1 ].to_i
end
|