yet another scala kitten
May. 2nd, 2012 02:34 pm1 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") } |