Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
1 |
package hammock |
|
2 |
|
|
3 |
import cats._ |
|
4 |
|
|
5 |
trait ContentType { |
|
6 |
def name: String |
|
7 |
}
|
|
8 |
|
|
9 |
object ContentType { |
|
10 | 1 |
val notUsed: ContentType = fromName("") |
11 | 1 |
val `application/json`: ContentType = fromName("application/json; charset=utf-8") |
12 | 1 |
val `application/octet-stream`: ContentType= fromName("application/octet-stream") |
13 | 1 |
val `text/plain`: ContentType = fromName("application/json") |
14 |
|
|
15 | 1 |
def fromName(givenName: String): ContentType = new ContentType { |
16 |
def name: String = givenName |
|
17 |
}
|
|
18 |
|
|
19 | 1 |
implicit val eq = new Eq[ContentType] { |
20 |
def eqv(x: ContentType, y: ContentType): Boolean = |
|
21 |
x.name == y.name |
|
22 |
}
|
|
23 |
}
|
Read our documentation on viewing source code .