generator-pyhipster
Version:
Python (Flask) + Angular/React/Vue in one handy generator
18 lines (15 loc) • 387 B
JavaScript
class JDLEnumValue {
constructor(name, value, comment) {
if (!name) {
throw new Error('The enum value name has to be passed to create an enum.');
}
this.name = name;
this.value = value;
this.comment = comment;
}
toString() {
const value = this.value ? ` (${this.value})` : '';
return `${this.name}${value}`;
}
}
module.exports = JDLEnumValue;