public Closure contents ( final Closure cl ) { return new Closure ( cl . getOwner ( ) , cl . getThisObject ( ) ) { private static final long serialVersionUID = - 5733727697043906478L ; @ Override public Object call ( ) { cl . call ( ) ; return "" ; } @ Override public Object call ( final Object ... args ) { cl . call ( args ) ; return "" ; } @ Override public Object call ( final Object arguments ) { cl . call ( arguments ) ; return "" ; } } ; }
Wraps a closure so that it can be used as a prototype for inclusion in layouts . This is useful when you want to use a closure in a model but that you don t want to render the result of the closure but instead call it as if it was a specification of a template fragment .