Advertisement
Guest User

Untitled

a guest
Aug 11th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.25 KB | None | 0 0
  1.   def read(title: String) = Action {
  2.     def tryGetTodo(title: String): Option[TodoData] =
  3.       if(todos.isEmpty) None
  4.       else todos.find(_.title == title)
  5.  
  6.     tryGetTodo(title).fold(NotFound) { todo =>
  7.       Json.toJson(todo)
  8.     }
  9.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement