1 | ;
|
2 |
|
3 | var UUID = require('uuid');
|
4 |
|
5 | /**
|
6 | *
|
7 | * @returns {ISchema}
|
8 | * @constructor
|
9 | */
|
10 | function SchemaFactory() {
|
11 | /**
|
12 | *
|
13 | * @class Schema
|
14 | *
|
15 | * @param {Object} model_config
|
16 | */
|
17 | function Schema(model_config) {
|
18 | var initialize_method = this.initialize || this.init;
|
19 |
|
20 | this.id = UUID.v4();
|
21 |
|
22 | if(initialize_method) {
|
23 | initialize_method.call(this, model_config);
|
24 | }
|
25 | }
|
26 |
|
27 | Schema.fn = Schema.prototype;
|
28 |
|
29 | return Schema;
|
30 | }
|
31 |
|
32 | module.exports = SchemaFactory;
|