I am wondering where methods can be defined and used in groovy/grails.
Specifically in the bootstrap init, I would like to do something like this:
def init = {
def util() {
return 'so helpful!'
}
def someObj = new someObj(phrase: util()).save()
}
Is this possible, or does util need to be defined outside of init?
I think defining named function within a function is not allowed. You can use a closure instead.