Groovy web console

subscribe to the feed Subscribe
to this
DSL for declaring type (via #groovywebconsole)
tweet this snippet Tweet

DSL for declaring type

Published 1 year ago by ajkerchum
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Closure closure = {
    thingy String

class Intro {
    Intro(Closure c) {
        c.delegate = this
        println this.class.declaredFields
    Object invokeMethod(String name, Object args) {
        println "Variable with name: ${name}, and class: ${args[0]}"

new Intro(closure)