A common mistake is for users to try and create a 10 card using '10' instead of 'T'. Add a nice error message if they
make this, or a similar, mistake.
athena ~ $ irb -r ruby-poker
>> PokerHand.new("10h")
NoMethodError: undefined method `-' for nil:NilClass
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/card.rb:33:in `face_value'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/card.rb:52:in `build_from_face_suit'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/card.rb:42:in `build_from_string'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/card.rb:75:in `initialize'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/ruby-poker.rb:26:in `new'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/ruby-poker.rb:26:in `initialize'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/ruby-poker.rb:26:in `map'
from /Library/Ruby/Gems/1.8/gems/ruby-poker-0.3.0/lib/ruby-poker.rb:26:in `initialize'
from (irb):1:in `new'
from (irb):1
|