formats.js
function Formats(options) {
    options = options || {};

    this.debugConstructor = options.debug || debug;
    this.debug = this.debugConstructor('oada:formats');
    this.errorConstructor = options.error || debug;
    this.error = this.errorConstructor('oada:formats:error');

    this.Model = Model;

    this.models = {};
    this.mediatypes = {};

    // Add the built in models
    this.use(require('./JsonModel'));

    // Add the built in media types
    this.use(require('./formats/index.js'));
}
function Formats(options) {
    options = options || {};

    this.debugConstructor = options.debug || debug;
    this.debug = this.debugConstructor('oada:formats');
    this.errorConstructor = options.error || debug;
    this.error = this.errorConstructor('oada:formats:error');

    this.Model = Model;

    this.models = {};
    this.mediatypes = {};

    // Add the built in models
    this.use(require('./JsonModel'));

    // Add the built in media types
    this.use(require('./formats/index.js'));
}
function Formats ( options ) { options = options || { } ; this . debugConstructor = options . debug || debug ; this . debug = this . debugConstructor ( 'oada:formats' ) ; this . errorConstructor = options . error || debug ; this . error = this . errorConstructor ( 'oada:formats:error' ) ; this . Model = Model ; this . models = { } ; this . mediatypes = { } ; // Add the built in models this . use ( require ( './JsonModel' ) ) ; // Add the built in media types this . use ( require ( './formats/index.js' ) ) ; }
Maintains and builds OADA format models
@constructor
@param {object} options - Various optional options
@param {function} options.debug - A custom debug logger, debug.js interface
@param {function} options.error - A custom error logger, debug.js interface
Maintains and builds OADA format models