Skip to content

Instantly share code, notes, and snippets.

@paganotoni
Created May 24, 2012 13:32
Show Gist options
  • Save paganotoni/2781567 to your computer and use it in GitHub Desktop.
Save paganotoni/2781567 to your computer and use it in GitHub Desktop.
Simple Groovy Mixin example
class Other {
def first = {
return list[0]
}
def hello(){
return "hello ${ myName() }"
}
}
@Mixin( Other )
​class Simple {
def list = [1]
def myName(){
return "Simple"
}
}
println new Simple().hello()
println new Simple().first()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment