3 4 5 6 7 8 9 10 11 12
# File 'lib/ttt/player_factory.rb', line 3 def self.create(input) case input[:type] when :ai AI.new(input[:mark]) when :human Human.new(input[:mark]) else raise "Invalid Player Type" end end