aboutsummaryrefslogtreecommitdiff
path: root/lib/finance.js
diff options
context:
space:
mode:
authorTobias Witt <[email protected]>2016-03-02 15:21:54 +0100
committerMarak <[email protected]>2016-03-03 04:30:38 -0500
commit90a6a04f9cd4a134fec20949e68beb4baf79bfae (patch)
tree70ada7191ace4c22e7d6a5ffa4a65a92d65c92a9 /lib/finance.js
parent9bb2b7c341bcf41e00341c92a8a66620c401c85f (diff)
downloadfaker-90a6a04f9cd4a134fec20949e68beb4baf79bfae.tar.xz
faker-90a6a04f9cd4a134fec20949e68beb4baf79bfae.zip
Install jsdoc and add doclet stubs for all methods
Descriptions are taken from existing comments if available. The address module already has some new sample descriptions.
Diffstat (limited to 'lib/finance.js')
-rw-r--r--lib/finance.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/lib/finance.js b/lib/finance.js
index 0140cd19..4c6d92a6 100644
--- a/lib/finance.js
+++ b/lib/finance.js
@@ -1,7 +1,17 @@
+/**
+ *
+ * @namespace faker.finance
+ */
var Finance = function (faker) {
var Helpers = faker.helpers,
self = this;
+ /**
+ * account
+ *
+ * @method faker.finance.account
+ * @param {number} length
+ */
self.account = function (length) {
length = length || 8;
@@ -15,11 +25,24 @@ var Finance = function (faker) {
return Helpers.replaceSymbolWithNumber(template);
}
+ /**
+ * accountName
+ *
+ * @method faker.finance.accountName
+ */
self.accountName = function () {
return [Helpers.randomize(faker.definitions.finance.account_type), 'Account'].join(' ');
}
+ /**
+ * mask
+ *
+ * @method faker.finance.mask
+ * @param {number} length
+ * @param {boolean} parens
+ * @param {boolean} elipsis
+ */
self.mask = function (length, parens, elipsis) {
@@ -50,6 +73,15 @@ var Finance = function (faker) {
//min and max take in minimum and maximum amounts, dec is the decimal place you want rounded to, symbol is $, €, £, etc
//NOTE: this returns a string representation of the value, if you want a number use parseFloat and no symbol
+ /**
+ * amount
+ *
+ * @method faker.finance.amount
+ * @param {number} min
+ * @param {number} max
+ * @param {number} dec
+ * @param {string} symbol
+ */
self.amount = function (min, max, dec, symbol) {
min = min || 0;
@@ -61,18 +93,38 @@ var Finance = function (faker) {
}
+ /**
+ * transactionType
+ *
+ * @method faker.finance.transactionType
+ */
self.transactionType = function () {
return Helpers.randomize(faker.definitions.finance.transaction_type);
}
+ /**
+ * currencyCode
+ *
+ * @method faker.finance.currencyCode
+ */
self.currencyCode = function () {
return faker.random.objectElement(faker.definitions.finance.currency)['code'];
}
+ /**
+ * currencyName
+ *
+ * @method faker.finance.currencyName
+ */
self.currencyName = function () {
return faker.random.objectElement(faker.definitions.finance.currency, 'key');
}
+ /**
+ * currencySymbol
+ *
+ * @method faker.finance.currencySymbol
+ */
self.currencySymbol = function () {
var symbol;