Class: TexasHoldem::FourOfAKind
Constant Summary
collapse
- Pattern =
/(\d{1,2})[scdh] (?:\s\1[scdh]){3}/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
58
59
60
|
# File 'lib/player_hand.rb', line 58
def self.create(cards)
new cards if cards.match Pattern
end
|
Instance Method Details
#base_score ⇒ Object
66
67
68
|
# File 'lib/player_hand.rb', line 66
def base_score
7
end
|
#name ⇒ Object
62
63
64
|
# File 'lib/player_hand.rb', line 62
def name
'four of a kind'
end
|
#relative_score ⇒ Object
70
71
72
|
# File 'lib/player_hand.rb', line 70
def relative_score
@cards[Pattern,1].to_i
end
|