aboutsummaryrefslogtreecommitdiff
path: root/lib/random.js
diff options
context:
space:
mode:
authorBryan Donovan <[email protected]>2013-01-06 19:09:00 -0800
committerBryan Donovan <[email protected]>2013-01-06 19:09:00 -0800
commit1a635e01e7e4899b0fd8f1746259d4598103c2c3 (patch)
tree4e76756270ddb92b514e7a3dfbdef4171699e15d /lib/random.js
parent0bdf6cb4bcef86c8d563ec1657f59b13a3da8560 (diff)
downloadfaker-1a635e01e7e4899b0fd8f1746259d4598103c2c3.tar.xz
faker-1a635e01e7e4899b0fd8f1746259d4598103c2c3.zip
initial address.unit.js
Diffstat (limited to 'lib/random.js')
-rw-r--r--lib/random.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/random.js b/lib/random.js
index a052ecc6..f1a4dfbd 100644
--- a/lib/random.js
+++ b/lib/random.js
@@ -17,6 +17,11 @@ var random = {
* Generate methods that return random elements from definition arrays.
*/
var method_names = [
+ // Address
+ 'city_prefix',
+ 'city_suffix',
+ 'street_suffix',
+
// Name
'first_name',
'last_name',
@@ -32,11 +37,10 @@ var method_names = [
'bs_noun'
];
-for (var i = 0; i < method_names.length; i++) {
- var method_name = method_names[i];
+method_names.forEach(function (method_name) {
random[method_name] = function () {
return random.array_rand(definitions[method_name]());
};
-}
+});
module.exports = random;