aboutsummaryrefslogtreecommitdiff
path: root/lib/name.js
diff options
context:
space:
mode:
authorcyanos3 <[email protected]>2013-11-05 20:10:31 -0700
committercyanos3 <[email protected]>2013-11-05 20:10:31 -0700
commitc8f71cd072b74c66693cae927bdaf9a97ee15c1f (patch)
treef7879114561edad1b2ca4f957c2063eece57f8f4 /lib/name.js
parente7aaa93c306fe9c7f0b662ff68f0a36426605283 (diff)
downloadfaker-c8f71cd072b74c66693cae927bdaf9a97ee15c1f.tar.xz
faker-c8f71cd072b74c66693cae927bdaf9a97ee15c1f.zip
My take on separating male and female names. Tests passing, Coverage restored.
Diffstat (limited to 'lib/name.js')
-rw-r--r--lib/name.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/name.js b/lib/name.js
index d806d64b..5ad87bc4 100644
--- a/lib/name.js
+++ b/lib/name.js
@@ -1,27 +1,35 @@
var Faker = require('../index');
var _name = {
- firstName: function ( gender ) {
- return Faker.random.first_name( gender );
+ firstName: function () {
+ return Faker.random.first_name();
+ },
+
+ firstNameMale: function () {
+ return Faker.random.first_name_male();
+ },
+
+ firstNameFemale: function () {
+ return Faker.random.first_name_female();
},
lastName: function () {
return Faker.random.last_name();
},
- findName: function ( gender ) {
+ findName: function () {
var r = Faker.random.number(8);
switch (r) {
- case 0:
- return Faker.random.name_prefix() + " " + this.firstName( gender ) + " " + this.lastName();
- case 1:
- return this.firstName( gender ) + " " + this.lastName() + " " + Faker.random.name_suffix();
+ case 0:
+ return Faker.random.name_prefix() + " " + this.firstName() + " " + this.lastName();
+ case 1:
+ return this.firstName() + " " + this.lastName() + " " + Faker.random.name_suffix();
}
- return this.firstName( gender ) + " " + this.lastName();
+ return this.firstName() + " " + this.lastName();
},
- gender: function() {
+ gender: function () {
return Faker.random.gender();
}
};