class OfcpScoring::HandFactory
Public Class Methods
new(categorizer = OfcpScoring::HandCategorizer.new)
click to toggle source
# File lib/ofcp_scoring/hand_factory.rb, line 2 def initialize(categorizer = OfcpScoring::HandCategorizer.new) @categorizer = categorizer end
Public Instance Methods
build(hand)
click to toggle source
# File lib/ofcp_scoring/hand_factory.rb, line 5 def build(hand) OfcpScoring::ChinesePokerHand.new({ :front => @categorizer.categorize(hand[0..2]), :middle => @categorizer.categorize(hand[3..7]), :back => @categorizer.categorize(hand[8..12]) }) end