- COPYRIGHT AND LICENSE
Router::Dumb::Route - just one dumb route for use in a big dumb router
The route's target is a string that can be used, for example, to give a file path or URL for the resource to which the user should be directed. Its meaning is left up to Router::Dumb's user.
parts attribute is an arrayref of strings that make up the route.
constraints attribute holds a hashref of Moose type constraints objects, up to one for each placeholder.
This method returns a list of the contents of the
my $part = $route->get_part( $n );
This returns the string located at position
$n in the parts array.
This returns the
/-joined list of path parts, or the empty string if
parts is empty.
This method behaves like
path, but placeholder parts are replaced with numbers so that, for example, instead of returning
foo/:bar/baz/:quux we would return
foo/:1/baz/:2. This normalization is used to prevent route collision.
This method returns true if the path ends in the slurpy
This method returns true if any of the route's path parts is a placeholder (i.e., starts with a colon).
This method returns a list of all the placeholders for which a constraint is registered.
my $tc = $route->constraint_for( $placeholder_name );
my $match_or_undef = $route->check( $str );
This is the method used by the router to see if each route will accept the string. If it matches, it returns a match object. Otherwise, it returns false.
Ricardo Signes <email@example.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.