No title Revision 353536656433 (Sat Jan 07 2012 at 19:40) - Diff Link to this snippet: https://friendpaste.com/4jZzCzEmUX6zaeaFerY9um Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 12345678910111213141516class << LotteryDraw def play final = LotteryTicket.new_random winners = {} @@tickets.each do |buyer, ticket_list| ticket_list.each do |ticket| score = ticket.score( final ) next if score.zero? winners[buyer] ||= [] winners[buyer] << [ ticket, score ] end end @@tickets.clear winners end end