Skip to content

Instantly share code, notes, and snippets.

@uehaj
Created July 19, 2013 11:23
Show Gist options
  • Select an option

  • Save uehaj/6038467 to your computer and use it in GitHub Desktop.

Select an option

Save uehaj/6038467 to your computer and use it in GitHub Desktop.
import org.codehaus.groovy.runtime.*
assert String.metaClass instanceof HandleMetaClass
String.metaClass.hello = {println "hello"}
"hoge".hello()
assert String.metaClass instanceof ExpandoMetaClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment