Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created May 16, 2013 23:13
Show Gist options
  • Save behrangsa/5595848 to your computer and use it in GitHub Desktop.
Save behrangsa/5595848 to your computer and use it in GitHub Desktop.
Sub/Super/Delegate
class Del {
def del() { println "Del.del" }
}
class Super {
def sup() { println "Super.sup" }
}
class Sub extends Super {
@Delegate Del del = new Del()
def sub() { println "Sub.sub" }
}
def sub = new Sub()
sub.del()
sub.sup()
sub.sub()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment