protected function validate($var, $ruleset = null, $locale = null, $lib= '\Enola\Lib\Validation\ValidationFields', $dir= null){
        $validation= new $lib($locale);
        if($dir == null){
            $dir= PATHAPP . 'src/content/messages';
        }
        $validation->dir_content= $dir;
        
        $ruleset= $ruleset != null ? $ruleset : $this->configValidation();
        
        if(is_object($var)){
            $reflection= new Reflection($var);
            foreach ($ruleset as $key => $regla) {
                $validation->add_rule($key, $reflection->getProperty($key), $regla);
            }
        }else{
            foreach ($ruleset as $key => $regla) {
                $field= isset($var[$key]) ? $var[$key] : NULL;
                $validation->add_rule($key, $field, $regla);
            }
        }
        if(! $validation->validate()){
            //Consigo los errores y retorno FALSE
            $this->errors= $validation->error_messages();
            return FALSE;
        }else{
            return TRUE;            
        }
    }