class EmailAssist {
def abcService = "abc"
String name
EmailAssist(String name) {
this.name = name
println abcService
}
EmailAssist() {
}
}
EmailAssist.metaClass.getAbcService = {->
"test"
}
def e = new EmailAssist("Joe")
println e.abcService
This results in output of
abc
test
I'd think it would result in
test
test
Can anyone explain what goes into this exactly? Does the metaclass only modify after the constructor executes, as opposed to overwriting constructor methodology?