aboutsummaryrefslogtreecommitdiff
path: root/lib/commerce.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/commerce.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/commerce.js')
-rw-r--r--lib/commerce.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/commerce.js b/lib/commerce.js
index ec91edb1..2c41455c 100644
--- a/lib/commerce.js
+++ b/lib/commerce.js
@@ -1,10 +1,26 @@
+/**
+ *
+ * @namespace faker.commerce
+ */
var Commerce = function (faker) {
var self = this;
+ /**
+ * color
+ *
+ * @method faker.commerce.color
+ */
self.color = function() {
return faker.random.arrayElement(faker.definitions.commerce.color);
};
+ /**
+ * department
+ *
+ * @method faker.commerce.department
+ * @param {number} max
+ * @param {number} fixedAmount
+ */
self.department = function(max, fixedAmount) {
return faker.random.arrayElement(faker.definitions.commerce.department);
@@ -26,12 +42,26 @@ var Commerce = function (faker) {
*/
};
+ /**
+ * productName
+ *
+ * @method faker.commerce.productName
+ */
self.productName = function() {
return faker.commerce.productAdjective() + " " +
faker.commerce.productMaterial() + " " +
faker.commerce.product();
};
+ /**
+ * price
+ *
+ * @method faker.commerce.price
+ * @param {number} min
+ * @param {number} max
+ * @param {number} dec
+ * @param {string} symbol
+ */
self.price = function(min, max, dec, symbol) {
min = min || 0;
max = max || 1000;
@@ -71,14 +101,29 @@ var Commerce = function (faker) {
};
*/
+ /**
+ * productAdjective
+ *
+ * @method faker.commerce.productAdjective
+ */
self.productAdjective = function() {
return faker.random.arrayElement(faker.definitions.commerce.product_name.adjective);
};
+ /**
+ * productMaterial
+ *
+ * @method faker.commerce.productMaterial
+ */
self.productMaterial = function() {
return faker.random.arrayElement(faker.definitions.commerce.product_name.material);
};
+ /**
+ * product
+ *
+ * @method faker.commerce.product
+ */
self.product = function() {
return faker.random.arrayElement(faker.definitions.commerce.product_name.product);
}