class Athena::Routing::RouteCollection
- Athena::Routing::RouteCollection
- Reference
- Object
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
- Enumerable({String, Athena::Routing::ActionBase})
- Iterable({String, Athena::Routing::ActionBase})
Direct Known Subclasses
Defined in:
routing/route_collection.crInstance Method Summary
-
#each(&) : Nil
Yields the name and
ART::Action
object for each registered route. -
#each
Returns an
Iterator
for each registered route. -
#get(name : String) : ART::ActionBase
Returns the
ART::Action
with the provided name. -
#get?(name : String) : ART::ActionBase | Nil
Returns the
ART::Action
with the provided name, ornil
if it does not exist. -
#routes : Hash(String, ART::ActionBase)
Returns the routes hash.
Instance Method Detail
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.
def get?(name : String) : ART::ActionBase | Nil
#
Returns the ART::Action
with the provided name, or nil
if it does not exist.