Last active
December 17, 2015 05:39
-
-
Save stephen101/5559754 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = | |
#Contains a hash of all the valid input field URI's, the key is the URI, the value | |
#contains a hash of instances of inputFields, for this hash the key is a combination of URI | |
#and GUID, we need this to know the diffirence between "INTEREST_RATE" for BankAccount1, | |
#vs "INTEREST_RATE" for BankAccount2. We get the GUID from the GUID generated in the UI | |
inputFields: {} | |
#contains a hash of all the valid output field URI's, the keys is the URI, the value | |
#contains a hash of instances of ouputFields, key is a combination of URI and GUID, | |
outputFields: {} | |
#contains a hash of all unique formulas. Key is the URI for the formula, the value | |
#is an object with the text representation of the formula, and a Js version of the function | |
formulas: {} | |
#maps input fields to all the output fields that use them, to be used for cascading updates | |
dependancies: {} | |
addInstance: (uri, id, value) -> | |
#if we don't have this uri do nothing, probably should throw an exception here | |
return unless uri of inputFields | |
inputFields[uri][guid] = value | |
getInstance: (uri, id) -> | |
#if we don't have this uri do nothing, probably should throw an exception here | |
return unless uri of inputFields | |
return inputFields[uri][guid] if guid of inputFields[uri] | |
deleteInstance: (uri, id) -> | |
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment