Class: AcpcPokerTypes::Hand

Inherits:
PileOfCards show all
Defined in:
lib/acpc_poker_types/hand.rb

Constant Summary

Constants inherited from PileOfCards

PileOfCards::POKER_HAND_STRENGTHS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PileOfCards

#all_cards, #largest_rank, #remaining_cards, #to_poker_hand_description, #to_poker_hand_key, #to_poker_hand_strength

Class Method Details

.draw_cards(*cards) ⇒ Hand

Returns:



8
9
10
# File 'lib/acpc_poker_types/hand.rb', line 8

def self.draw_cards(*cards)
  AcpcPokerTypes::Hand.new cards
end

.from_acpc(acpc_string_hand) ⇒ Hand

Parameters:

  • acpc_string_hand (String)

    ACPC string description of a hand.

Returns:



14
15
16
# File 'lib/acpc_poker_types/hand.rb', line 14

def self.from_acpc(acpc_string_hand)
  AcpcPokerTypes::Hand.new AcpcPokerTypes::Card.cards(acpc_string_hand)
end

Instance Method Details

#to_acpcObject



24
25
26
# File 'lib/acpc_poker_types/hand.rb', line 24

def to_acpc
  (map { |card| card.to_acpc }).join
end

#to_sObject Also known as: to_str



18
19
20
# File 'lib/acpc_poker_types/hand.rb', line 18

def to_s
  join
end