13 lines
No EOL
331 B
JavaScript
Executable file
13 lines
No EOL
331 B
JavaScript
Executable file
function StepVoter(options) {
|
|
Voter.apply(this, arguments);
|
|
this._step = options.step || 1;
|
|
}
|
|
StepVoter.prototype = Object.create(Voter.prototype);
|
|
|
|
StepVoter.prototype._increase = function() {
|
|
this.setVote(this._vote + this._step);
|
|
};
|
|
|
|
StepVoter.prototype._decrease = function() {
|
|
this.setVote(this._vote - this._step);
|
|
}; |