UNPKG

jest-cucumber

Version:
38 lines 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CertificateFactory = void 0; var CertificateFactory = /** @class */ (function () { function CertificateFactory() { this.title = ''; this.lastName = ''; this.score = 0; this.rank = 'Novice'; } CertificateFactory.prototype.setReceiver = function (title, name, score) { this.title = title; this.lastName = name; this.score = Number.parseInt(score, 10); if (this.score > 2700) { this.rank = 'Super Grandmaster'; } else if (this.score > 2500) { this.rank = 'Grandmaster'; } else if (this.score > 2000) { this.rank = 'Expert'; } }; CertificateFactory.prototype.printCertificate = function () { var pieces = [ "Certificate of Mastery", "The title of " + this.rank + " is hereby awarded to:", this.title + " " + this.lastName, "For achieving a score of " + this.score + ", " + this.title + " " + this.lastName, "may henceforth use the title " + this.rank + ".", ]; return pieces.join('\n'); }; return CertificateFactory; }()); exports.CertificateFactory = CertificateFactory; //# sourceMappingURL=certificate-factory.js.map