Add class who contain listener info

This commit is contained in:
Amaury Joly 2021-02-07 13:03:40 +01:00
parent de195f8592
commit 4b653194f6

View File

@ -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;