Last active
May 14, 2018 21:38
-
-
Save amuradyan/18dbc844f00fb30721e9c0b37ada65b4 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): MailBuilder= ??? | |
def CC(ccEmail: String): MailBuilder = ??? | |
} | |
object Mailer { | |
def main(args: Array[String]) { | |
val mailFromClient = new Mail("", "") | |
send a new Mail("asd", "asd") | |
reply to mailFromClient withMessage "asd" CC "exo@gmail.com" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment