Created
April 30, 2010 21:19
-
-
Save benjaminjackman/385768 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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