Refactor random verbs, phrases, and compliments so that only the resources controller is concerned with how to fetch them and how to make them randomly. Remove debug statement from bonfire/show.jade

This commit is contained in:
Nathan Leniz
2015-01-25 10:02:41 -05:00
parent 0e63521ee0
commit d886a77858
4 changed files with 28 additions and 46 deletions

View File

@ -167,7 +167,22 @@ module.exports = {
});
});
});
}
},
randomPhrase: function() {
var phrases = resources.phrases;
return phrases[Math.floor(Math.random() * phrases.length)];
},
randomVerb: function() {
var verbs = resources.verbs;
return verbs[Math.floor(Math.random() * verbs.length)];
},
randomCompliment: function() {
var compliments = resources.compliments;
return compliments[Math.floor(Math.random() * compliments.length)];
}
};