Verified Commit 4d035e90 authored by Jules Sagot--Gentil's avatar Jules Sagot--Gentil
Browse files

feat(article): implémentation de la méthode affiche pour ArticleRSS

parent b0044a58
Pipeline #469857081 passed with stage
in 59 seconds
......@@ -7,9 +7,23 @@ export interface Article {
}
export class ArticleRSS implements Article {
constructor(item: Parser.Item) {};
private item: Parser.Item;
affiche(sortie: Writable) {};
constructor(item: Parser.Item) {
this.item = item;
};
affiche(sortie: Writable) {
this.afficheElement(sortie, 'Titre', this.item.title);
this.afficheElement(sortie, 'Lien', this.item.link);
this.afficheElement(sortie, 'Description', this.item.content);
};
private afficheElement(sortie: Writable, header: string, content: string | undefined) {
sortie.write(`${header}: `);
sortie.write(content);
sortie.write(`\n`);
}
egal(autreArticle: Article) { return false };
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment