Class: Hand

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PileOfCards

#to_poker_hand_strength

Class Method Details

.draw_cards(*cards) ⇒ Hand

Returns:



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

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

.from_acpc(acpc_string_hand) ⇒ Hand

Parameters:

  • acpc_string_hand (String)

    ACPC string description of a hand.

Returns:



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

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

Instance Method Details

#to_acpcObject



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

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

#to_sObject Also known as: to_str



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

def to_s
  join
end