Skip to content

Instantly share code, notes, and snippets.

@manuelzapata
Created February 14, 2019 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manuelzapata/da5326f2880a5b3dc7ebd86b8e262e17 to your computer and use it in GitHub Desktop.
Save manuelzapata/da5326f2880a5b3dc7ebd86b8e262e17 to your computer and use it in GitHub Desktop.
class ConvertidorDatos {
constructor(formato) {
this.formato = formato;
}
convertir(datos) {
}
}
class ConvertidorXML extends ConvertidorDatos {
constructor() {
super('xml');
}
convertir(datos) {
console.log('convirtiendo desde XML');
//lógica para transformar desde XML...
}
}
class ConvertidorCSV extends ConvertidorDatos {
constructor() {
super('csv');
}
convertir(datos) {
console.log('convirtiendo desde CSV');
//lógica para transformar desde CSV...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment