Created
May 27, 2017 16:13
-
-
Save matsu-chara/46e268cd525ec44dfab94bd0db43bcd4 to your computer and use it in GitHub Desktop.
基本的には実装詳細を隠蔽しつつDBに入れる時など限定で値を取り出す方法
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 Foo(value: Int) | |
case class Bar(value: String) | |
case class Baz(private val foo: Foo, private val bar: Bar) { | |
def fooBar: String = foo.value.toString + bar.value | |
} | |
val baz = Baz(Foo(1), Bar("bar")) | |
scala> Baz.unapply | |
case def unapply(x$0: Baz): Option[(Foo, Bar)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment