2
function GetRatioNode(dob, salary, contextName)
6
this.contextName = contextName;
8
this.render = function( context )
10
var dob = this.dob.resolve(context);
11
var salary = this.salary.resolve(context);
12
var today = new Date();
13
var ageMS = today - dob;
14
var ageYears = ageMS / (1000 * 60 * 60 * 24 * 365);
15
var ratio = salary / ageYears;
16
context.insert(this.contextName, ratio);
20
function GetRatioNodeFactory( tagContent, parser )
22
var tagArgs = AbstractNodeFactory.smartSplit(tagContent);
23
var node = new Node("GetRatioNode", FilterExpression(tagArgs[1]), FilterExpression(tagArgs[2]), tagArgs[4]);
26
Library.addFactory("GetRatioNodeFactory", "get_ratio");