Class: PokerRanking::HandType::FullHouse

Inherits:
Base
  • Object
show all
Defined in:
lib/hand_type/full_house.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?, #number_of_kickers, #straight_value_of

Constructor Details

This class inherits a constructor from PokerRanking::HandType::Base

Instance Method Details

#cards_usedObject



30
31
32
# File 'lib/hand_type/full_house.rb', line 30

def cards_used
  cards_for_values_and_kickers value, second_value
end

#handles?Boolean

Returns:

  • (Boolean)


5
6
7
8
# File 'lib/hand_type/full_house.rb', line 5

def handles?
  return false unless n_of_a_kind? 3
  second_value > 0
end

#kickersObject



22
23
24
# File 'lib/hand_type/full_house.rb', line 22

def kickers
  []
end

#nameObject



26
27
28
# File 'lib/hand_type/full_house.rb', line 26

def name
  'full house'
end

#rankObject



10
11
12
# File 'lib/hand_type/full_house.rb', line 10

def rank
  6
end

#second_valueObject



14
15
16
# File 'lib/hand_type/full_house.rb', line 14

def second_value
  highest_same_value_except(2, value)
end

#valueObject



18
19
20
# File 'lib/hand_type/full_house.rb', line 18

def value
  highest_same_value 3
end