You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mock_server.rb
    path of file: ./repos/semian/test/helpers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "webrick"

class MockServer
  class << self
    def start(hostname:, port:)
      new(hostname: hostname, port
    
  def poll_until_ready(time_to_wait: 1)
    timer_start = Process.clock_gettime(Process::CLOCK_MONOTONIC)

    TCPSocket.new(@hostname, @port).close
  rescue Errno::ECONNREFUSED, Errno::ECONNRESET
    elapsed = Process.clock_gettime(Process::CLOCK_MONOTONIC) - timer_start
    if elapsed > time_to_wait
      raise "Couldn't reach the service on hostname #{@hostname} port #{@port} after #{time_to_wait}s"
    end