Add class who contain listener info
This commit is contained in:
parent
de195f8592
commit
4b653194f6
42
src/Models/ListenerRSSInfos.js
Normal file
42
src/Models/ListenerRSSInfos.js
Normal 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;
|
Loading…
Reference in New Issue
Block a user