I inserted this line into my init() of my BootStrap class
Integer.metaClass.minutes = { 60000L * delegate }
I was then not able to use it from a Job class (Quartz plugin). Do I put this line of code somewhere else to make it a global modification?
I was also wondering the best way to make a function available inside all classes in Grails. Like a global function. Would it be to extend the Object metaclass? or is there a better way?
def time = use( TimeCategory ) { 10.minutes.toMilliseconds() }... Although this doesn't answer your question ;-) - tim_yatesTimeCategoryis a GroovyCategory. Theusefunction can be thought of as a way to temporarially add functionality to a class, so inside theuse(){ ... }block, the Category is in effect and integers are decorated with time based properties. Similar to adding a method to themetaClass, but more localised. - tim_yatesTimeCategoryhas moved to thegroovy.time.*package, which shouldn't affect things until Grails starts using it (v1.4?) - tim_yates