headius (owner)

Fork Of

gist: 228837 by anonymous

Revisions

gist: 229179 Download_button fork
public
Public Clone URL: git://gist.github.com/229179.git
Embed All Files: show embed
Java #
1
2
3
4
5
6
7
8
9
10
11
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()