module Athena::Routing::Matcher::RequestMatcherInterface
Overview
Similar to ART::Matcher::URLMatcherInterface, but tries to match against an ART::Request.
Direct including types
Defined in:
matcher/request_matcher_interface.crInstance Method Summary
-
#match(request : ART::Request) : Hash(String, String | Nil)
Tries to match the provided request to its related route.
-
#match?(request : ART::Request) : Hash(String, String | Nil) | Nil
Tries to match the provided request to its related route.
Instance Method Detail
abstract
def 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.
abstract
def 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.