def connect
      gremlin = self
      WebSocket::Client::Simple.connect("ws://#{@host}:#{@port}#{@path}") do |ws|
        @ws = ws

        @ws.on :message do |msg|
          gremlin.receive_message(msg)
        end

        @ws.on :error do |e|
          receive_error(e)
        end
      end
    end
def connect
      gremlin = self
      WebSocket::Client::Simple.connect("ws://#{@host}:#{@port}#{@path}") do |ws|
        @ws = ws

        @ws.on :message do |msg|
          gremlin.receive_message(msg)
        end

        @ws.on :error do |e|
          receive_error(e)
        end
      end
    end
initialize a new connection using:
   host    => hostname/ip where to connect
   port    => listen port of the server
   timeout => how long the client might wait for response from the server
 creates a new connection object