smartcheck/ts/classes.ts

27 lines
671 B
TypeScript
Raw Normal View History

2015-11-28 21:20:24 +00:00
/// <reference path="./index.ts" />
class Check {
name:string;
result:string;
constructor(nameArg:string,resultArg:string){
this.name = nameArg;
this.result = resultArg;
}
}
class CheckStorage {
checks:Check[];
constructor() {
this.checks = [];
}
addCheck(name:string,result:string){
var localCheck = new Check(name,result);
this.checks.push(localCheck);
}
print() {
2015-11-28 21:34:32 +00:00
var localTable = beautylog.table.new("checks");
2015-11-28 21:20:24 +00:00
for (var check in this.checks){
localTable.push([this.checks[check].name,this.checks[check].result]);
}
2015-11-28 21:34:32 +00:00
localTable.print();
2015-11-28 21:20:24 +00:00
}
}