When I'm calling a function in Groovy, how do I determine the class of the caller?
For example, I want to know what the class of foo
is, inside the printFoo()
function:
foo.printFoo()
def printFoo() {
print(this.class)
}
And this should print out the class of foo