Class: TexasHoldem::Straight
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
116
117
118
119
120
|
# File 'lib/player_hand.rb', line 116
def self.create(cards)
straight = new cards
card_values = straight.cards.gsub(/[scdh]/,'').split.map {|card_value| card_value.to_i }
new(cards) if (card_values.first..card_values.last).to_a == card_values
end
|
Instance Method Details
#base_score ⇒ Object
126
127
128
|
# File 'lib/player_hand.rb', line 126
def base_score
4
end
|
#name ⇒ Object
122
123
124
|
# File 'lib/player_hand.rb', line 122
def name
'straight'
end
|
#relative_score ⇒ Object
130
131
132
|
# File 'lib/player_hand.rb', line 130
def relative_score
face_values_array.last.to_i
end
|