class Athena::Routing::Matcher::URLMatcher

Overview

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

Included Modules

Direct Known Subclasses

Defined in:

matcher/url_matcher.cr

Constructors

Instance Method Summary

Instance methods inherited from module Athena::Routing::Matcher::URLMatcherInterface

match(path : String) : Hash(String, String | Nil) match, match?(path : String) : Hash(String, String | Nil) | Nil match?

Instance methods inherited from module Athena::Routing::RequestContextAwareInterface

context : ART::RequestContext context, context=(context : ART::RequestContext) context=

Instance methods inherited from module Athena::Routing::Matcher::RequestMatcherInterface

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

Constructor Detail

def self.new(context : ART::RequestContext) #

[View source]

Instance Method Detail

def context : ART::RequestContext #
Description copied from module Athena::Routing::RequestContextAwareInterface

Returns the request context.


[View source]
def context=(context : ART::RequestContext) #
Description copied from module Athena::Routing::RequestContextAwareInterface

Sets the request context.


[View source]
def match(path : String) : Hash(String, String | Nil) #

Tries to match the provided path to its related route. Returns a hash of 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.


[View source]
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.


[View source]
def match?(path : String) : Hash(String, String | Nil) | Nil #

Tries to match the provided path to its related route. Returns a hash of 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.


[View source]
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.


[View source]