protected function get($parts, $subject)
    {
        $part = array_shift($parts);

        if (!$this->has($part, $subject)) {
            $type = is_object($subject) ? get_class($subject) : gettype($subject);
            throw new \Exception(sprintf("Can't find %s in %s", $part, $type));
        } elseif (is_array($subject)) {
            $value = $subject[$part];
        } elseif (method_exists($subject, $part)) {
            $value = call_user_func(array($subject, $part));
        } else {
            $value = $subject->$part;
        }

        if (count($parts) == 0) {
            return $value;
        } else {
            return $this->get($parts, $value);
        }
    }