domotz-remote-pawn
Version:
Domotz Agent
16 lines (13 loc) • 317 B
JavaScript
/*
* Helper for testing object instantiation/serialization
*/
var Counter = module.exports = function(value) {
if(typeof(value) !== 'number' || !isFinite(value)) value = 0;
this.count = value;
};
/*
* Increment internal counter
*/
Counter.prototype.incrementBy = function(value) {
this.count += value;
};