| Total Complexity | 5 |
| Complexity/F | 1.25 |
| Lines of Code | 35 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | /** |
||
| 4 | module.exports = function(GedcomX){ |
||
| 5 | |||
| 6 | // Extend serialization properties |
||
| 7 | GedcomX.Coverage.jsonProps.push('recordType'); |
||
| 8 | |||
| 9 | // Override init() |
||
| 10 | var oldCoverageInit = GedcomX.Coverage.prototype.init; |
||
| 11 | GedcomX.Coverage.prototype.init = function(json){ |
||
| 12 | oldCoverageInit.call(this, json); |
||
| 13 | if(json){ |
||
| 14 | this.setRecordType(json.recordType); |
||
| 15 | } |
||
| 16 | }; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Set the record type |
||
| 20 | * |
||
| 21 | * @param {String} recordType |
||
| 22 | * @return {Coverage} this |
||
| 23 | */ |
||
| 24 | GedcomX.Coverage.prototype.setRecordType = function(recordType){ |
||
| 25 | this.recordType = recordType; |
||
| 26 | return this; |
||
| 27 | }; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get the record type |
||
| 31 | * |
||
| 32 | * @return {String} recordType |
||
| 33 | */ |
||
| 34 | GedcomX.Coverage.prototype.getRecordType = function(){ |
||
| 35 | return this.recordType; |
||
| 36 | }; |
||
| 37 | |||
| 38 | }; |