public function to($type)
    {
        switch ($type) {
            case 'ini':
                $this->string = Ini::encode($this->data);
                break;

            case 'json':
                $this->string = Json::encode($this->data, $this->prettyOutput);
                break;

            case 'php':
                $this->string = Php::encode($this->data);
                break;

            case 'xml':
                $this->string = Xml::encode($this->data, $this->prettyOutput);
                break;

            case 'yml':
            case 'yaml':
                $this->string = Yaml::encode($this->data);
                break;
            
            default:
                throw new \Exception("Format not supported: " . $type);
        }

        return $this->string;
    }