Class: PokerRanking::HandType::Straight

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

Constructor Details

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

Instance Method Details

#cards_usedObject



21
22
23
# File 'lib/hand_type/straight.rb', line 21

def cards_used
  cards_in_straight(cards)[-5..-1]
end

#handles?Boolean

Returns:

  • (Boolean)


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

def handles?
  value > 0
end

#kickersObject



25
26
27
# File 'lib/hand_type/straight.rb', line 25

def kickers
  []
end

#nameObject



17
18
19
# File 'lib/hand_type/straight.rb', line 17

def name
  'straight'
end

#rankObject



9
10
11
# File 'lib/hand_type/straight.rb', line 9

def rank
  4
end

#valueObject



13
14
15
# File 'lib/hand_type/straight.rb', line 13

def value
  straight_value_of cards
end