class Athena::Routing::Router
- Athena::Routing::Router
- Reference
- Object
Included Modules
Defined in:
router.crConstructors
Instance Method Summary
-
#context : ART::RequestContext
Returns the request context.
-
#context=(context : ART::RequestContext)
Sets the request context.
-
#generate(route : String, params : Hash(String, String | Nil) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : String
Generates a URL for the provided route, optionally with the provided params and reference_type.
-
#generate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String
Generates a URL for the provided route, optionally with the provided params and reference_type.
- #generator : ART::Generator::Interface
-
#match(path : String) : Hash(String, String | Nil)
Tries to match the provided path to its related route.
-
#match(request : ART::Request) : Hash(String, String | Nil)
Tries to match the provided request to its related route.
-
#match?(path : String) : Hash(String, String | Nil) | Nil
Tries to match the provided path to its related route.
-
#match?(request : ART::Request) : Hash(String, String | Nil) | Nil
Tries to match the provided request to its related route.
- #matcher : ART::Matcher::URLMatcherInterface
-
#route_collection : ART::RouteCollection
:inherit:
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?
Instance methods inherited from module Athena::Routing::RouterInterface
route_collection : ART::RouteCollection
route_collection
Instance methods inherited from module Athena::Routing::Generator::Interface
generate(route : String, params : Hash(String, String | Nil) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : Stringgenerate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String generate
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::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=
Constructor Detail
Instance Method Detail
Generates a URL for the provided route, optionally with the provided params and reference_type.
Generates a URL for the provided route, optionally with the provided params and reference_type.
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.
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.
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.
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.