Created
September 16, 2013 21:28
-
-
Save ryoppy/6586825 to your computer and use it in GitHub Desktop.
valを気軽にオーバーライド
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
case class A { | |
val now = System.currentTimeMillis | |
} | |
// for UnitTest | |
val a1 = new A { override val now = new DateTime("2013-01-01") } | |
println(a1.now) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment