Sha256: 1a5441f3bf79eb1dada4e4acd45cca156354b32253386f741e817e35485a0e71

Contents?: true

Size: 503 Bytes

Versions: 8

Compression:

Stored size: 503 Bytes

Contents

require File.expand_path('../pile_of_cards', __FILE__)
require File.expand_path('../card', __FILE__)

class Hand < PileOfCards
  # @return [Hand]
  def self.draw_cards(*cards)
    Hand.new cards
  end

  # @param [String] acpc_string_hand ACPC string description of a hand.
  # @return [Hand]
  def self.from_acpc(acpc_string_hand)
    Hand.new Card.cards(acpc_string_hand)
  end

  def to_s
    join
  end

  alias_method :to_str, :to_s

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
acpc_poker_types-0.0.10 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.9 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.8 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.7 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.6 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.5 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.4 lib/acpc_poker_types/hand.rb
acpc_poker_types-0.0.2 lib/acpc_poker_types/hand.rb