pepegar / hammock
1
package hammock
2

3
import cats.{Show, Eq}
4
import cats.instances.string._
5
import cats.syntax.contravariant._
6

7
trait Method {
8
  def name: String
9
}
10

11
object Method {
12
  case object OPTIONS extends Method {
13 0
    def name: String = "OPTIONS"
14
  }
15
  case object GET extends Method {
16 0
    def name: String = "GET"
17
  }
18
  case object HEAD extends Method {
19 0
    def name: String = "HEAD"
20
  }
21
  case object POST extends Method {
22 0
    def name: String = "POST"
23
  }
24
  case object PUT extends Method {
25 0
    def name: String = "PUT"
26
  }
27
  case object DELETE extends Method {
28 0
    def name: String = "DELETE"
29
  }
30
  case object TRACE extends Method {
31 0
    def name: String = "TRACE"
32
  }
33
  case object CONNECT extends Method {
34 0
    def name: String = "CONNECT"
35
  }
36
  case object PATCH extends Method {
37 0
    def name: String = "PATCH"
38
  }
39

40 0
  implicit val show: Show[Method] = Show[String].contramap(_.name)
41 0
  implicit val eq: Eq[Method] = Eq.fromUniversalEquals
42
}

Read our documentation on viewing source code .

Loading