Skip to content

Instantly share code, notes, and snippets.

@benjaminjackman
Created April 30, 2010 21:19
Show Gist options
  • Save benjaminjackman/385768 to your computer and use it in GitHub Desktop.
Save benjaminjackman/385768 to your computer and use it in GitHub Desktop.
class Settings extends Record {
import Dsl._
val maxQty = req("maxQty", 1, IntTransformer).ensuring{v=> v >=! 0}
//Alternate version
val maxQty = req("maxQty", 1, IntTransformer).ensuring(>=!0).ensuring(!==!666)
val minQty = opt(req("minQty", 2, IntTransformer).ensuring(>=!0))
override def check : Option[ErrorMsg] = {
maxQty.value >=! minQty.value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment