Add class who contain listener info
This commit is contained in:
		
							
								
								
									
										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;
 | 
				
			||||||
		Reference in New Issue
	
	Block a user