Fossil::Router
Inherits Reference < Object
Router class. A instance of a class is a node in a route tree.
Constructors
Instance methods
New Routers are implicitly created with calling a slash operator.
root = Fossil::Router.new ""
root / "route_a/its_child"
root / "route_b/@param1:int/info"
Routers that may can go after self and do not start with a path parameter.
Endpoints at the route that is resolved to current Router.
Routers that may can go after self and do start with a path parameter.
Type of a parameter is a key in a Hash, so its capacity is equal to 3.
Routers that may can go after self and do start with a path parameter.
Type of a parameter is a key in a Hash, so its capacity is equal to 3.
Name of a path parameter a path that can be resolved to one of the endpoints down the tree from the current node starts with.
While @path is a whole fragment between two slashes, @parameter is parsed from a fragment "@<parameter_name>:<parameter_type>",
where <parameter_type> is of type Fossil::Param::PathParamTypeEnum (string that can be parsed to this enum).
The first path fragment of a path that can be resolved to one of the endpoints down the tree from the current node.
If @path.is_nil the fragment is a path parameter.
Trace path down the tree from the current router and pass all found path parameters in path_params.