Browse files

updated api annotations

  • Loading branch information...
1 parent 9cdb0e7 commit b0209b5d5918801aa2387c55936f7ec2558464fa @goulash1971 committed Jun 18, 2011
Showing with 15 additions and 1 deletion.
  1. +5 −1 lib/index.js
  2. +2 −0 lib/patches/dbref.js
  3. +2 −0 lib/plugins/dbrefHooks.js
  4. +3 −0 lib/plugins/resolveDBRefs.js
  5. +3 −0 lib/types/dbref.js
View
6 lib/index.js
@@ -1,5 +1,5 @@
/**
- * lib/index.js - module loader
+ * lib/index.js - extension loader
*
* Copyright 2011, Stuart Hudson <goulash1971@yahoo.com>
* Released under the terms of the MIT License.
@@ -22,6 +22,7 @@ exports.utils = utils = require("./utils");
* @param {Mongoose} the active Mongoose instance for installation
* @param {Array} (optional) type filenames
* @return the utilities of the extension (see './utils.js')
+ * @api public
*/
exports.loadTypes = loadTypes = function (mongoose) {
var types = Array.prototype.slice.call(arguments, 1);
@@ -47,6 +48,7 @@ exports.loadTypes = loadTypes = function (mongoose) {
* @param {Mongoose} the active Mongoose instance for installation
* @param {Array} (optional) plugin filenames
* @return the utilities of the extension (see './utils.js')
+ * @api public
*/
exports.installPlugins = installPlugins = function (mongoose) {
var plugins = Array.prototype.slice.call(arguments, 1);
@@ -71,6 +73,7 @@ exports.installPlugins = installPlugins = function (mongoose) {
* @param {Mongoose} the active Mongoose instance for installation
* @param {Array} (optional) patch filenames
* @return the utilities of the extension (see './utils.js')
+ * @api public
*/
exports.installPatches = installPatches = function (mongoose) {
var patches = Array.prototype.slice.call(arguments, 1);
@@ -95,6 +98,7 @@ exports.installPatches = installPatches = function (mongoose) {
*
* @param {Mongoose} the active Mongoose instance for installation
* @return the utilities of the extension (see './utils.js')
+ * @api public
*/
exports.install = function (mongoose) {
loadTypes (mongoose);
View
2 lib/patches/dbref.js
@@ -15,6 +15,7 @@ var mongoose = require("mongoose");
*
* @param {Connection} a database connection
* @param {Function} standard callback '(err, doc)'
+ * @api public
*/
var dbrefFetch = function (conn, callback) {
conn.db.dereference(this, callback);
@@ -25,6 +26,7 @@ var dbrefFetch = function (conn, callback) {
* Installer that installs a plugin into the mongoose infrastructure
*
* @param {Mongoose} the active Mongoose instance for installation
+ * @api public
*/
exports.install = function (mongoose) {
mongoose.Types.DBRef.prototype.fetch = dbrefFetch;
View
2 lib/plugins/dbrefHooks.js
@@ -25,6 +25,7 @@ var mongoose = require("mongoose");
*
* @param {Object} the schema the plugin is being used against
* @param {Object} global options that apply to this plugin
+ * @api public
*/
exports.dbrefHooks = dbrefHooks = function (schema, options) {
if (!('mongoose' in options))
@@ -51,6 +52,7 @@ exports.dbrefHooks = dbrefHooks = function (schema, options) {
* Installer that installs a plugin into the mongoose infrastructure
*
* @param {Mongoose} the active Mongoose instance for installation
+ * @api public
*/
exports.install = function (mongoose) {
return mongoose.plugin(dbrefHooks, {mongoose: mongoose});
View
3 lib/plugins/resolveDBRefs.js
@@ -14,6 +14,7 @@ var mongoose = require("mongoose");
*
* @param {String} the path name
* @return {Object} specifying the 'cache', 'getter' and 'setter'
+ * @api private
*/
var namesForPath = function (path) {
var root = path.replace(/^[_]+/g,"");
@@ -50,6 +51,7 @@ var namesForPath = function (path) {
*
* @param {Object} the schema the plugin is being used against
* @param {Object} global options that apply to this plugin
+ * @api public
*/
exports.resolveDBRefs = resolveDBRefs = function (schema, options) {
if (!('mongoose' in options))
@@ -114,6 +116,7 @@ exports.resolveDBRefs = resolveDBRefs = function (schema, options) {
* Installer that installs a plugin into the mongoose infrastructure
*
* @param {Mongoose} the active Mongoose instance for installation
+ * @api public
*/
exports.install = function (mongoose) {
return mongoose.plugin(resolveDBRefs, {mongoose: mongoose});
View
3 lib/types/dbref.js
@@ -12,6 +12,7 @@ var mongoose = require("mongoose");
* Utility function that will cast a single object for a condition
*
* @param {Object} the single object to be handled
+ * @api private
*/
function handleSingle (value) {
return this.cast(value);
@@ -21,6 +22,7 @@ function handleSingle (value) {
* Utility function that will cast an array for a condition
*
* @param {Array} the array of objects to be handled
+ * @api private
*/
function handleArray (value) {
var self = this;
@@ -32,6 +34,7 @@ function handleArray (value) {
* Loader that loads the type into the mongoose infrastructure
*
* @param {Mongoose} the active Mongoose instance for installation
+ * @api public
*/
exports.loadType = function (mongoose) {
// The types that are used for schema and models

0 comments on commit b0209b5

Please sign in to comment.