OX::RouteBuilder - abstract role for classes that turn configuration into a route
version 0.04
This is an abstract role which is used to turn simplified and easy to understand routing descriptions into actual routes that the router understands. Currently, the API is a bit specific to Path::Router.
For usable examples, see OX::RouteBuilder::ControllerAction, OX::RouteBuilder::HTTPMethod, and OX::RouteBuilder::Code.
The path that this route is for. Required.
The route_spec that describes how this path should be routed. See OX::Application::Role::RouteBuilder. Required.
route_spec
The defaults and validations for this path. See Path::Router for more information. Required.
defaults
validations
This is a required method which should generate a list of routes based on the contents of the object. Each route should be a hashref with these keys:
Path specification for the route.
Coderef to call to handle the request.
Extra values which will be included in the resulting match.
Validation rules for variable path components. See Path::Router for more information.
Required class method which should take the actual action specification provided in the user's router description and return either a route_spec that can be understood by OX::Application::Role::RouteBuilder or undef (if the action spec wasn't of the form that could be understood by this class).
Helper method which sorts the params into defaults and validations.
params
Stevan Little <stevan.little at iinteractive.com>
Jesse Luehrs <doy at cpan dot org>
This software is copyright (c) 2012 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OX
CPAN shell
perl -MCPAN -e shell install OX
For more information on module installation, please visit the detailed CPAN module installation guide.