in module/geb-core/src/main/groovy/geb/content/PageContentTemplateBuilder.groovy [82:119]
def methodMissing(String name, args) {
def definition = null
def params = null
if (PageContentNames.isNotAllowed(container.unwrap(), name)) {
throwInvalidContent(name, "uses a not allowed content name: '$name'. Please use another name.")
}
if (args.size() == 0) {
throwInvalidContent(name, "contains no definition")
} else if (args.size() == 1) {
if ((args[0] instanceof Map)) {
params = args[0]
} else {
definition = args[0]
}
} else if (args.size() == 2) {
params = args[0]
definition = args[1]
}
if (params != null && !(params instanceof Map)) {
throwBadInvocationError(name, args)
}
if (definition != null) {
if (!(definition instanceof Closure)) {
throwBadInvocationError(name, args)
}
} else {
if (params?.aliases == null) {
throwBadInvocationError(name, args)
}
}
def template = create(name, params, definition)
templates[name] = template
template
}