aboutsummaryrefslogtreecommitdiff
path: root/lib/hacker.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hacker.js')
-rw-r--r--lib/hacker.js59
1 files changed, 29 insertions, 30 deletions
diff --git a/lib/hacker.js b/lib/hacker.js
index ca6bfb2d..463f8331 100644
--- a/lib/hacker.js
+++ b/lib/hacker.js
@@ -1,38 +1,37 @@
-var faker = require('../index');
+var Hacker = function (faker) {
+ var self = this;
+
+ self.abbreviation = function () {
+ return faker.random.arrayElement(faker.definitions.hacker.abbreviation);
+ };
-var hacker = {
+ self.adjective = function () {
+ return faker.random.arrayElement(faker.definitions.hacker.adjective);
+ };
- abbreviation : function () {
- return faker.random.array_element(faker.definitions.hacker.abbreviation);
- },
+ self.noun = function () {
+ return faker.random.arrayElement(faker.definitions.hacker.noun);
+ };
- adjective : function () {
- return faker.random.array_element(faker.definitions.hacker.adjective);
- },
+ self.verb = function () {
+ return faker.random.arrayElement(faker.definitions.hacker.verb);
+ };
- noun : function () {
- return faker.random.array_element(faker.definitions.hacker.noun);
- },
+ self.ingverb = function () {
+ return faker.random.arrayElement(faker.definitions.hacker.ingverb);
+ };
- verb : function () {
- return faker.random.array_element(faker.definitions.hacker.verb);
- },
-
- ingverb : function () {
- return faker.random.array_element(faker.definitions.hacker.ingverb);
- },
-
- phrase : function () {
+ self.phrase = function () {
var data = {
- abbreviation: hacker.abbreviation(),
- adjective: hacker.adjective(),
- ingverb: hacker.ingverb(),
- noun: hacker.noun(),
- verb: hacker.verb()
+ abbreviation: self.abbreviation(),
+ adjective: self.adjective(),
+ ingverb: self.ingverb(),
+ noun: self.noun(),
+ verb: self.verb()
};
- var phrase = faker.random.array_element([ "If we {{verb}} the {{noun}}, we can get to the {{abbreviation}} {{noun}} through the {{adjective}} {{abbreviation}} {{noun}}!",
+ var phrase = faker.random.arrayElement([ "If we {{verb}} the {{noun}}, we can get to the {{abbreviation}} {{noun}} through the {{adjective}} {{abbreviation}} {{noun}}!",
"We need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!",
"Try to {{verb}} the {{abbreviation}} {{noun}}, maybe it will {{verb}} the {{adjective}} {{noun}}!",
"You can't {{verb}} the {{noun}} without {{ingverb}} the {{adjective}} {{abbreviation}} {{noun}}!",
@@ -44,9 +43,9 @@ var hacker = {
return faker.helpers.mustache(phrase, data);
- },
-
-
+ };
+
+ return self;
};
-module.exports = hacker;
+module['exports'] = Hacker; \ No newline at end of file