Skip to content

Commit

Permalink
updated api annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
goulash1971 committed Jun 18, 2011
1 parent 9cdb0e7 commit b0209b5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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.
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/patches/dbref.js
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions lib/plugins/dbrefHooks.js
Expand Up @@ -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))
Expand All @@ -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});
Expand Down
3 changes: 3 additions & 0 deletions lib/plugins/resolveDBRefs.js
Expand Up @@ -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,"");
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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});
Expand Down
3 changes: 3 additions & 0 deletions lib/types/dbref.js
Expand Up @@ -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);
Expand All @@ -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;
Expand All @@ -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
Expand Down

0 comments on commit b0209b5

Please sign in to comment.