class

Athena::Routing::Matcher::URLMatcher

Inherits Athena::Routing::Matcher::URLMatcherInterface < Athena::Routing::RequestContextAwareInterface < Athena::Routing::Matcher::RequestMatcherInterface < Reference < Object

Default implementation of ART::Matcher::RequestMatcherInterface and ART::Matcher::URLMatcherInterface.

Constructors

new(context : ART::RequestContext, route_provider : ART::RouteProvider.class = ART::RouteProvider)
Source

Instance methods

context

Returns the request context.

Source
context=(context : ART::RequestContext)

Sets the request context.

Source
match(path : String) : ART::Parameters

Tries to match the provided path to its related route. Returns an ART::Parameters containing the route's defaults and parameters resolved from the path.

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

Raises an ART::Exception::MethodNotAllowed if a route exists but not for the current HTTP method.

Source
match(request : ART::Request) : ART::Parameters

Tries to match the provided request to its related route. Returns an ART::Parameters containing 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.

Source
match?(path : String) : ART::Parameters | Nil

Tries to match the provided path to its related route. Returns an ART::Parameters containing the route's defaults and parameters resolved from the path.

Returns nil if no route could be matched or a route exists but not for the current HTTP method.

Source
match?(request : ART::Request) : ART::Parameters | Nil

Tries to match the provided request to its related route. Returns an ART::Parameters containing 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.

Source