private function setRestDriver($restDriver)
    {
        $namespace = '\\' . __NAMESPACE__ . '\\RestClient\\';
        $driver = $namespace . $restDriver;
        $parent = $namespace . 'DriverInterface';

        if (
            empty($restDriver)
            || !class_exists($driver)
            || !is_subclass_of($driver, $parent)
        ) {
            throw new InvalidArgumentException('rest driver', $driver);
        }

        // create a new REST Driver
        $this->restDriver = new $driver();
        if (isset($this->url)) {
            $this->restDriver->setHost($this->url);
        }
    }