Class
Hand
In: cards.rb
Parent: Object

Deck
Hand
TopLevel
Methods

accept, count, has?, new, remove, values,
Public Class methods
new()

-method to add a new empty hand to a player

    # File cards.rb, line 21
21:   def initialize;@h=[];end
Public Instance methods
accept(c;)

-method to add a card to a players hand

    # File cards.rb, line 23
23:   def accept c;@h.push c;end
count()

-method to count how many cards are in a hand

    # File cards.rb, line 25
25:   def count;@h.size;end
has?(v;)

-method that returns true if the hand contains one or more cards of a given value -method that returns true if the hand contains one or more cards of a given suit

    # File cards.rb, line 30
30:   def has? v;@h.detect{|c|c=~/#{v}/};end
remove(c;)

-method to remove a particular card from a hand.

    # File cards.rb, line 27
27:   def remove c;@h.delete c;end
values()

-method to return values of the cards in a hand ( H6, C3, SK, etc )

    # File cards.rb, line 32
32:   def values;@h.inject{|s,c|s<<" "+c};end