Skip to content

Instantly share code, notes, and snippets.

@headius
Forked from anonymous/gist:228837
Created November 8, 2009 08:33
Show Gist options
  • Save headius/229179 to your computer and use it in GitHub Desktop.
Save headius/229179 to your computer and use it in GitHub Desktop.
String.metaClass.methodMissing { String name, args ->
String camel = ''
name.split('_').eachWithIndex { part, i ->
if (i == 0) camel += part
else camel += (part[0].toUpperCase() + part[1..-1])
}
delegate."$camel"(args)
}
println "Who got their Ruby all over my Groovy?".to_upper_case()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment