Skip to content

module Athena::Routing::Matcher::RequestMatcherInterface #

Similar to ART::Matcher::URLMatcherInterface, but tries to match against an ART::Request.

Direct including types

Athena::Routing::Matcher::URLMatcher Athena::Routing::Router

Methods#

abstract #match(request : ART::Request) : Hash(String, String | Nil)#

Tries to match the provided request to its related route. Returns a hash of the route's defaults and parameters resolved from the request.

Raises an ART::Exception::ResourceNotFound if no route could be matched.

Raises an ART::Exception::MethodNotAllowed if a route exists but not for the request's method.

View source

abstract #match?(request : ART::Request) : Hash(String, String | Nil) | Nil#

Tries to match the provided request to its related route. Returns a hash of the route's defaults and parameters resolved from the request.

Returns nil if no route could be matched or a route exists but not for the request's method.

View source