Skip to content

Instantly share code, notes, and snippets.

@dwins
Created February 2, 2012 21:59
Show Gist options
  • Save dwins/1726053 to your computer and use it in GitHub Desktop.
Save dwins/1726053 to your computer and use it in GitHub Desktop.
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