UNPKG

@kyi193/kevins-thought-machine

Version:

Randomly return an answer for a yes or no question

44 lines (35 loc) 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var IfFanOfThisMovieBadResponse = /*#__PURE__*/function () { function IfFanOfThisMovieBadResponse() { _classCallCheck(this, IfFanOfThisMovieBadResponse); this.movies = ['The Hunger Games Series', 'Gravity', 'Avatar (by James Cameron)', 'Memento', 'Catwoman', 'Gigli', 'Disaster Movie', 'Movie 43', 'The Mummy 3']; this.randomMovie; } _createClass(IfFanOfThisMovieBadResponse, [{ key: "getAnswer", value: function getAnswer() { var randomMovieIdx = Math.floor(Math.random() * this.movies.length); var randomMovie = this.movies[randomMovieIdx]; this.randomMovie = randomMovie; return "If you thought ".concat(randomMovie, " was a good movie, then unfortunately there is no hope..."); } }, { key: "getResults", value: function getResults() { return { answer: this.getAnswer(), index: 10, randomMovie: this.randomMovie }; } }]); return IfFanOfThisMovieBadResponse; }(); exports["default"] = IfFanOfThisMovieBadResponse;