SHOW:
|
|
- or go back to the newest paste.
| 1 | - | def text = 'hello world!' |
| 1 | + | def TIME_TABLE = [h: 3600, m:60, s:1] |
| 2 | - | |
| 2 | + | |
| 3 | - | String.metaClass.camelize = {
|
| 3 | + | Integer.metaClass.getProperty = { String symbol -> TIME_TABLE[symbol] * delegate}
|
| 4 | - | delegate.split().inject(""){ before, word ->
|
| 4 | + | |
| 5 | - | before += word[0].toUpperCase() + word[1..-1] |
| 5 | + | assert 2.h + 30.m + 50.s == 9050 |
| 6 | - | } |
| 6 | + | |