aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/reading/models/Difficulty.scala
blob: e20d7b2e62572be81659e23092309ebf99cdebee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package reading.models

object Difficulty {
  val filters: Seq[Filter] =
    Seq(
      new Filter {
        def filter(book: Book): Boolean = book.pages < 200
        val kind: FilterKind = DifficultyKind
        val name: String = "facile"
      },
      new Filter {
        def filter(book: Book): Boolean = book.pages >= 200 && book.pages < 400
        val kind: FilterKind = DifficultyKind
        val name: String = "moyen"
      },
      new Filter {
        def filter(book: Book): Boolean = book.pages > 400
        val kind: FilterKind = DifficultyKind
        val name: String = "difficile"
      }
    )
}