graphviz-builder/lib/Element.ts

20 lines
434 B
TypeScript
Raw Normal View History

2020-04-24 12:02:32 +02:00
export class Element {
public name: string;
public parent: string;
public get full_name (): string {
2020-04-24 12:21:26 +02:00
if (this.parent)
return `${this.parent}_${this.name}`;
return this.name;
2020-04-24 12:02:32 +02:00
}
public constructor (name: string, parent = '') {
this.name = name;
this.parent = parent;
}
// eslint-disable-next-line @typescript-eslint/naming-convention
public toString (): string {
return this.full_name;
}
}