Created
February 2, 2012 21:59
-
-
Save dwins/1726053 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
trait Request | |
class RequestVerbs(req: Request) { | |
def <:< (headers: Map[String, String]): Request | |
} | |
implicit def requestsForVerbs(req: Request): RequestVerbs = | |
new RequestVerbs(req) | |
def url(theUrl: String): Request | |
url(someUrl) <:< Map("name" -> "value") | |
// translates to: | |
requestsForVerbs(url(someUrl)) <:< Map("name" -> "value") | |
// because of the implicit modifier on requestsForVerbs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment