Skip to content

Instantly share code, notes, and snippets.

@pr1001
Created August 23, 2011 06:10
Show Gist options
  • Save pr1001/1164460 to your computer and use it in GitHub Desktop.
Save pr1001/1164460 to your computer and use it in GitHub Desktop.
class Page(val id: String) extends Iterable[Page] {
def URLMatch(req: Request): Option[Page] = {
req match {
case r if urlParamMatches(r) => Some(this)
case r if urlPatternMatches(r) => Some(this)
case r if parent.isDefined => parent.get.URLMatch(r)
case _ => None
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment