Groovy web console

subscribe to the feed Subscribe
to this
site
thing (via #groovywebconsole)
tweet this snippet Tweet
this
script

thing

Published 7 months ago by shane
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts


class Person {
    def name
    def age
}

def p = new Person(name: "shane", age: "100")
def command = "getName getAge"
command.split(" ").each { c->
    println c
    println p."$c"()
}