UNPKG

@appshuttle.io/turing

Version:
63 lines (50 loc) 1.3 kB
const SegueAction = require('./ActionTypes/Segue') const SystemAction = require('./ActionTypes/System') class SHAction { constructor(parameters) { this.actionId = parameters.id this.actionType = parameters.type if (this.actionType === 'SEGUE') { this.segue = new SegueAction(parameters.segue) } else if (this.actionType === 'SYSTEM') { this.systemAction = new SystemAction(parameters.systemAction) } } getActionId() { return this.actionId } setActionId(actionId) { this.actionId = actionId } getActionType() { return this.actionType } setActionType(actionType) { this.actionType = actionType } getSegue() { return this.segue } setSegue(segue) { this.segue = segue } isSegue() { if (this.segue && this.actionType === 'SEGUE') { return true } return false } getSystemAction() { return this.systemAction } setSystemAction(systemAction) { this.systemAction = systemAction } isSystemAction() { if (this.systemAction && this.actionType === 'SYSTEM') { return true } return false } } module.exports = SHAction