Results 1 to 5 of 5
Jun 21, 2006, 08:39 #1
Help with a customization problem
I think that's the best way to put it.
I have a string I'm outputting that is built with this line:
1st 2nd 3rd 4th Final Montana 7 7 14 7 35 Michigan 0 0 7 7 14
This certainly has many, many solutions. I'm having some problems coming up with any good ones. Some considerations:
1) The customization will be saved and applied to all future output. Basically the user should be able to create this customized look and it will be used again in other games outputs (this example is for American football box scores so there are other games outputs that will be generated).
2) Following from above this customization should be able to be applied to any and all future box score outputs as a template.
3) The solution should be flexible enough to allow it to be used to allow users to customize other types of output like collections (that will be loops for outputting).
My current thought is to have the user create a psuedo code string with placeholders for the AR objects attributes and somehow applying this to the above code example. Not sure how to go about this best though. Also not sure this is the best way to do it. I feel like I'm missing some Ruby magic that would allow me to do this better. Maybe using some sort of decorator pattern for the AR object to alter it's output? The dynamic nature of AR objects though makes this tricky for me and I'm not sure how to proceed. Any and all suggestions and help are greatly appreciated. Thanks.Erh