From 4b653194f635b2f7372d12839c49eedb86ebc658 Mon Sep 17 00:00:00 2001 From: Amaury Joly Date: Sun, 7 Feb 2021 13:03:40 +0100 Subject: [PATCH] Add class who contain listener info --- src/Models/ListenerRSSInfos.js | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/Models/ListenerRSSInfos.js diff --git a/src/Models/ListenerRSSInfos.js b/src/Models/ListenerRSSInfos.js new file mode 100644 index 0000000..6259838 --- /dev/null +++ b/src/Models/ListenerRSSInfos.js @@ -0,0 +1,42 @@ +class ListenerRSSInfos { + _name = undefined; // name of the listener + _address = undefined; // feed's address + _timeloop = 5 * 60; // update time RSS feed + _customfields = [] // rss fields custom + + + constructor(name, address, timeloop, customfields) { + if(name !== undefined && address !== undefined) { + this._name = name; + this._address = address; + this._timeloop = timeloop; + this._customfields = customfields; + } else throw new Error('Bad constructor\'s args'); + } + + set timeloop(value) { + this._timeloop = value; + } + + set customfields(value) { + this._customfields = value; + } + + get name() { + return this._name; + } + + get address() { + return this._address; + } + + get timeloop() { + return this._timeloop; + } + + get customfields() { + return this._customfields; + } +} + +module.exports = ListenerRSSInfos; \ No newline at end of file