{"size": 809, "ext": "js", "max_stars_repo_path": "lib/procesos/api/kanji/base.js", "max_stars_repo_name": "eoi-vigo-japones/k_api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/procesos/api/kanji/base.js", "max_issues_repo_name": "eoi-vigo-japones/k_api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/procesos/api/kanji/base.js", "max_forks_repo_name": "eoi-vigo-japones/k_api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.3863636364, "max_line_length": 75, "alphanum_fraction": 0.587144623}
const ProcesoBase = require("../../base_swagger.js");

module.exports = class extends ProcesoBase{

  __formatearKanjiDesdeClave(){

    return this.info.getKanji()

      .then((k) => {

        this.k = k;

        return this.__formatearKanjiDesdeId()

      })

  }

  __formatearKanjiDesdeId(){

    this.producto().id = this.k.simbolo; 

    return this.k.getInfo()

      .then((info) => {
      
        this.producto().clave = info.clave;
        this.producto().solo_componente = info.solo_componente == 1;  
        this.producto().como_componente = info.como_componente.split(/\|/);
        this.producto().componentes = info.componentes.split(/\,/);

        return this.k.getHistoria()
      })

      .then((historia) => {

        this.producto().historia = historia.cuerpo;

      })

  }

}
