class Athena::Routing::RouteCollection

Overview

Wrapper around all the registered routes of an application. Routes are cached as a class variables since they're immutable once the program has been built.

Included Modules

Direct Known Subclasses

Defined in:

routing/route_collection.cr

Instance Method Summary

Instance Method Detail

def each(&) : Nil #

Yields the name and ART::Action object for each registered route.


[View source]
def each #

Returns an Iterator for each registered route.


[View source]
def get(name : String) : ART::ActionBase #

Returns the ART::Action with the provided name.

Raises a KeyError if a route with the provided name does not exist.


[View source]
def get?(name : String) : ART::ActionBase | Nil #

Returns the ART::Action with the provided name, or nil if it does not exist.


[View source]
def routes : Hash(String, ART::ActionBase) #

Returns the routes hash.


[View source]