lib/fakery.js
function(name, model, attributes) {
    if (name != null && model == null && attributes == null) return factories[name];
    if (model == null) return;
    if (attributes == null) attributes = {};
    factories[name] = new Factory(name, model, attributes);
}
function(name, model, attributes) {
    if (name != null && model == null && attributes == null) return factories[name];
    if (model == null) return;
    if (attributes == null) attributes = {};
    factories[name] = new Factory(name, model, attributes);
}
function ( name , model , attributes ) { if ( name != null && model == null && attributes == null ) return factories [ name ] ; if ( model == null ) return ; if ( attributes == null ) attributes = { } ; factories [ name ] = new Factory ( name , model , attributes ) ; }
Adds a factory object in `factories`. If a factory with the given name
is already defined, it will get overriden. If only `name` is provided
then it acts as a getter for the named factory.

Params:
- name: the name of the factory, as a string
- model: the mongoose model class
- attributes: hash with model attributes

Examples:
>>> fakery.fake('test', TestModel, {name: fakery.g.name()});
// => undefined
>>> fakery.fake('test');
// => {name: 'test', model: TestModel, attributes: {name: ...}};
Adds a factory object in factories . If a factory with the given name is already defined it will get overriden . If only name is provided then it acts as a getter for the named factory .