Class: PokerRanking::HandType::StraightFlush
- Inherits:
-
Base
- Object
- Base
- PokerRanking::HandType::StraightFlush
show all
- Defined in:
- lib/hand_type/straight_flush.rb
Constant Summary
collapse
- SUITS =
%w(Hearts Diamonds Spades Clubs)
Instance Attribute Summary
Attributes inherited from Base
#cards
Instance Method Summary
collapse
Methods inherited from Base
#cards_for_values_and_kickers, #cards_in_straight, #highest_same_value, #highest_same_value_except, #initialize, #n_of_a_kind?, #number_of_kickers, #second_value, #straight_value_of
Instance Method Details
#cards_used ⇒ Object
27
28
29
30
31
32
|
# File 'lib/hand_type/straight_flush.rb', line 27
def cards_used
SUITS.each do |suit|
straight_in_suite = cards_in_straight(cards.select { |card| card.suit == suit })
return straight_in_suite[-5..-1] if straight_in_suite.length >= 5
end
end
|
#handles? ⇒ Boolean
7
8
9
|
# File 'lib/hand_type/straight_flush.rb', line 7
def handles?
(value > 0)
end
|
#kickers ⇒ Object
34
35
36
|
# File 'lib/hand_type/straight_flush.rb', line 34
def kickers
[]
end
|
#name ⇒ Object
23
24
25
|
# File 'lib/hand_type/straight_flush.rb', line 23
def name
'straight flush'
end
|
#rank ⇒ Object
11
12
13
|
# File 'lib/hand_type/straight_flush.rb', line 11
def rank
8
end
|
#value ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/hand_type/straight_flush.rb', line 15
def value
SUITS.each do |suit|
value_for_suit = straight_value_of(cards.select { |card| card.suit == suit })
return value_for_suit if value_for_suit > 0
end
0
end
|