pepegar / hammock
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 0
      x.name == y.name
22
  }
23
}

Read our documentation on viewing source code .

Loading