The Groovy support provides the following key features:
Closurebased Handler Chain building DSL - see
- Dynamic templates based on embedded groovy code - see
- Defining applications as a single script - see
Use of closures and
Ratpack makes heavy use of a feature of Groovy 2.1 that allows the delegate of a closure to be specified via the type system.
On all parts of the API where a
Closure is being accepted as a method parameter, the parameter will be
annotated with this annotation. This specifies the type of the closure delegate object during execution.
For more information on closure delegates, see this article.
When reading the API reference, it's important to take note of the
DelegatesTo annotation on closure parameters.
This parameter indicates what type to look at for information on what the closure can do.