def chat(message)
      final_message = message.is_a?(Hash) ? message.to_json : JSON.dump(action: 'message', message: message)
      log_debug("#{@actor.class} sends JSON #{final_message}")
      connection.text final_message
    end
def chat(message)
      final_message = message.is_a?(Hash) ? message.to_json : JSON.dump(action: 'message', message: message)
      log_debug("#{@actor.class} sends JSON #{final_message}")
      connection.text final_message
    end
method used to send messages to the webserver
 checks too see if the message is a hash and if it is it will transform it to JSON and send it to the webser
 otherwise will construct a JSON object that will have the key action with the value 'message" and the key message witth the parameter's value

 @param [Hash] message

 @return [void]

 @api private