Class: PokerRanking::HandType::TwoPair
- Inherits:
-
Base
- Object
- Base
- PokerRanking::HandType::TwoPair
show all
- Defined in:
- lib/hand_type/two_pair.rb
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?, #straight_value_of
Instance Method Details
#cards_used ⇒ Object
34
35
36
|
# File 'lib/hand_type/two_pair.rb', line 34
def cards_used
cards_for_values_and_kickers value, second_value
end
|
#handles? ⇒ Boolean
6
7
8
|
# File 'lib/hand_type/two_pair.rb', line 6
def handles?
has_two_pair?
end
|
#kickers ⇒ Object
26
27
28
|
# File 'lib/hand_type/two_pair.rb', line 26
def kickers
[[super,highest_same_value_except(2,[value,second_value])].flatten.max]
end
|
#name ⇒ Object
30
31
32
|
# File 'lib/hand_type/two_pair.rb', line 30
def name
'two pairs'
end
|
#number_of_kickers ⇒ Object
18
19
20
|
# File 'lib/hand_type/two_pair.rb', line 18
def number_of_kickers
1
end
|
#rank ⇒ Object
10
11
12
|
# File 'lib/hand_type/two_pair.rb', line 10
def rank
2
end
|
#second_value ⇒ Object
22
23
24
|
# File 'lib/hand_type/two_pair.rb', line 22
def second_value
highest_same_value_except(2, value)
end
|
#value ⇒ Object
14
15
16
|
# File 'lib/hand_type/two_pair.rb', line 14
def value
highest_same_value 2
end
|