I have in my html something like this:
<input type="text" data-validators="length(5,25);notNull();links(1);" />
Functions: length, notNull and links are in my Validation class. I am getting these functions with jQuery
$(this).find('[data-validation]').each ->
validatorsString = $(this).attr "data-validation"
validatorsArray = validatorsString.split ";"
validatorsObject = new Validation($(this).val())
for v in validatorsArray
if typeof validatorsObject[v] == "function"
validatorsObject[v]
This works fine when I dont use parameters (arg1, arg2) but now I want to use parameters. How to check if these functions exists in class and execute it with paramters (with no limits, it can be 1, 5, 10 params)