]> src.bluestatic.org Git - ustaxlib.git/blob - src/Person.ts
Add Line.test.ts.
[ustaxlib.git] / src / Person.ts
1 export enum Relation {
2 Self,
3 Spouse,
4 Dependent,
5 };
6
7 export class Person {
8 private _name: string;
9 private _relation: Relation;
10
11 constructor(name: string, relation: Relation) {
12 this._name = name;
13 this._relation = relation;
14 }
15
16 get name(): string {
17 return this._name;
18 }
19
20 get relation(): Relation {
21 return this._relation;
22 }
23
24 static self(name: string): Person {
25 return new Person(name, Relation.Self);
26 }
27
28 static spouse(name: string): Person {
29 return new Person(name, Relation.Spouse);
30 }
31
32 static dependent(name: string): Person {
33 return new Person(name, Relation.Dependent);
34 }
35 };