Created
June 1, 2011 03:23
-
-
Save diegodfsd/1001741 to your computer and use it in GitHub Desktop.
meta programação
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pessoa | |
{ | |
String nome | |
def methodMissing(String name, args) | |
{ | |
println "o método '${name}' não foi implementado." | |
} | |
} | |
Pessoa.metaClass.propertyMissing = {name, args -> println "A propriedade '${name}' não existe." } | |
p = new Pessoa() | |
p.nome = "Diego Dias" | |
println p.nome | |
p.idade | |
p.Novo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment