Skip to content

Instantly share code, notes, and snippets.

@ricardohsd
Created April 19, 2012 19:08
Show Gist options
  • Save ricardohsd/2423194 to your computer and use it in GitHub Desktop.
Save ricardohsd/2423194 to your computer and use it in GitHub Desktop.
Classe js
;(function(exports){
function PaymentCalculator (value, fine, interest) {
this._value = value;
this._fine = fine;
this._interest = interest;
}
PaymentCalculator.prototype.value = function () {
return this._value;
};
PaymentCalculator.prototype.fine = function () {
return this._fine;
};
PaymentCalculator.prototype.interest = function () {
return this._interest;
};
PaymentCalculator.prototype.total = function () {
return this.value() + this.fine() + this.interest();
};
exports.PaymentCalculator = PaymentCalculator;
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment