| Total Complexity | 6 |
| Complexity/F | 1.2 |
| Lines of Code | 58 |
| Function Count | 5 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | /* global SARAH */ |
||
| 25 | function SarahActionContext(data, callback) { |
||
| 26 | 3 | this.data = data; |
|
| 27 | 3 | this.callback = callback; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @public |
||
| 32 | * @returns {Object} |
||
| 33 | */ |
||
| 34 | 1 | SarahActionContext.prototype.getData = function() { |
|
| 35 | 1 | return this.data; |
|
| 36 | }; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @public |
||
| 40 | * @returns {callable} |
||
| 41 | */ |
||
| 42 | 1 | SarahActionContext.prototype.getCallback = function() { |
|
| 43 | 1 | return this.callback; |
|
| 44 | }; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @public |
||
| 48 | * For SARAH v3 (For SARAH v4 Sarah instance is global) |
||
| 49 | * @param {SARAH} SARAH SARAH instance |
||
| 50 | */ |
||
| 51 | 1 | SarahActionContext.prototype.setSARAH = function(SARAH) { |
|
| 52 | 1 | this.SARAH = SARAH; |
|
| 53 | }; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @public |
||
| 57 | * @returns {SARAH} |
||
| 58 | */ |
||
| 59 | 1 | SarahActionContext.prototype.getSARAH = function() { |
|
| 60 | 2 | return typeof SARAH === 'object' |
|
| 61 | ? SARAH // Sarah v4 |
||
| 62 | : this.SARAH; |
||
| 63 | }; |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @private |
||
| 67 | * @type {SARAH|null} |
||
| 68 | */ |
||
| 69 | 1 | SarahActionContext.prototype.SARAH = null; |
|
| 70 | /** |
||
| 71 | * @private |
||
| 72 | * @type {callable} |
||
| 73 | */ |
||
| 74 | 1 | SarahActionContext.prototype.callback = null; |
|
| 75 | /** |
||
| 76 | * @private |
||
| 77 | * @type {Object} |
||
| 78 | */ |
||
| 79 | 1 | SarahActionContext.prototype.data = null; |
|
| 80 | |||
| 81 | /* Export class */ |
||
| 82 | module.exports = SarahActionContext; |
||
| 83 |