public function route()
    {
        $args = func_get_args();

        if (isset($args[0]) && ($args[0] instanceof DirectionsRequest)) {
            $directionsRequest = $args[0];
        } elseif ((isset($args[0]) && is_string($args[0])) && (isset($args[1]) && is_string($args[1]))) {
            $directionsRequest = new DirectionsRequest();

            $directionsRequest->setOrigin($args[0]);
            $directionsRequest->setDestination($args[1]);
        } else {
            throw DirectionsException::invalidDirectionsRequestParameters();
        }

        if (!$directionsRequest->isValid()) {
            throw DirectionsException::invalidDirectionsRequest();
        }

        $response = $this->send($this->generateUrl($directionsRequest));
        $directionsResponse = $this->buildDirectionsResponse($this->parse($response->getBody()));

        return $directionsResponse;
    }