Juan-Carlos Gandhi (
juan_gandhi) wrote2012-05-02 02:34 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
yet another scala kitten
1 2 3 4 5 6 7 8 9 10 11 | def retrieveProps(c: Container, file: String) { val prop = new { def apply(key: String) = c.getPropertyOrFail(key, throw new IllegalArgumentException( "missing " + key + " in " + file)).getValue } val name = prop("username") val pass = prop("password") val db = prop("database") } |