Created
May 14, 2018 21:32
-
-
Save amuradyan/42a0401191eb1a7bf26485497541e945 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
package mailer | |
/** | |
* Created by spectrum on 5/14/2018. | |
*/ | |
class Mail(from: String, to: String) | |
object send { | |
def a(mail: Mail) = ??? | |
} | |
object reply { | |
def to(mail: Mail): MailBuilder = { | |
MailBuilder(mail) | |
} | |
} | |
case class MailBuilder(mail: Mail) { | |
def withMessage(message: String) = ??? | |
} | |
object Mailer { | |
def main(args: Array[String]) { | |
val mailFromClient = new Mail("", "") | |
send a new Mail("asd", "asd") | |
reply to mailFromClient withMessage "asd" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment