Class: TexasHoldem::Flush
Constant Summary
collapse
- Pattern =
/\d{1,2}([csdh]) (?:\s\d{1,2}\1){4} /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
98
99
100
|
# File 'lib/player_hand.rb', line 98
def self.create(cards)
new(cards) if cards.match Pattern
end
|
Instance Method Details
#base_score ⇒ Object
106
107
108
|
# File 'lib/player_hand.rb', line 106
def base_score
5
end
|
#name ⇒ Object
102
103
104
|
# File 'lib/player_hand.rb', line 102
def name
'flush'
end
|
#relative_score ⇒ Object
110
111
112
|
# File 'lib/player_hand.rb', line 110
def relative_score
face_values_array.sort.last.to_i
end
|