﻿var Template = function(template) {
    this.template = template;
};

Template.prototype.evaluate = function(data) {
    var output = this.template;
	
    if (data != undefined) {
        for (var tag in data) {
			var pattern = new RegExp('\\{\\['+tag+'\\]\\}', 'g');
			output = output.replace(pattern, data[tag]);
        }
    }

    return (output);
};