Ruby-Poker 0.2.1

Ruby-Poker 0.2.1 is an incremental update over the 0.2.0 release. The biggest change is the addition of the << and delete methods to the PokerHand object. Making it possible to add and remove cards from a hand without creating a new PokerHand object.

require 'rubygems'
require 'ruby-poker'
 
hand.PokerHand.new("3d 3s 7h 7d")
hand.to_s                   # => "3d 3s 7h 7d (Two pair)"
 
hand << "7c"
hand.to_s                   # => "3d 3s 7h 7d 7c (Full house)"
 
hand.delete("3d")
hand.delete("3s")
hand.to_s                   # => 7h 7d 7c (Three of a kind)"

I’m always in the process of adding documentation to ruby-poker. At this point the majority of the public facing methods of the PokerHand and Card classes have been documented with examples. The ruby-docs are available online at http://rubypoker.rubyforge.org/.

4 thoughts on “Ruby-Poker 0.2.1

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>