1

Have a SimpleTemplate class that returns a Writable object. Can this be done as i can't see what kind of object to return. I have tried someting like this:

  Writable getTemplate()  { return 'something that's a writable' }  

and how would i read variable from another method ?

jnorthr
  • 52
  • 6

1 Answers1

1

You could do this to return some writable string content:

Writable getTemplate() {
    { it.println "Some content" }.asWritable()
}
tim_yates
  • 167,322
  • 27
  • 342
  • 338