The cards_that_are(:ace) line was the first approach that came to mind. I have a C# implementation I did a few years ago that was more sophisticated. It broke out an abstract "HandEvaluator" class so that different evaluators could be used for different games (e.g. BlackjackHandEvaluator), but the same Hand class could be used over and over.