Skip to content

Instantly share code, notes, and snippets.

@int128
Created March 29, 2016 13:20
Show Gist options
  • Save int128/2840142fbf884b678dfc to your computer and use it in GitHub Desktop.
Save int128/2840142fbf884b678dfc to your computer and use it in GitHub Desktop.
Using closure of Groovy2 on Groovy1
class ClosureBridge {
static Closure wrap(closureOnAnotherWorld) {
{ ->
closureOnAnotherWorld.delegate = delegate
closureOnAnotherWorld.resolveStrategy = resolveStrategy
closureOnAnotherWorld.call()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment