Class

RouteBuilder

Extends:

There's no documentation for this item.

Public Attributes
optional_separators
separators
Public Methods
assign_default_route_options Assign default options, such as ‘index’ as a default for :action. This method must be run after user supplied requirements and defaults have been applied to the segments.
assign_route_options Takes a hash of defaults and a hash of requirements, and assigns them to the segments. Any unused requirements (which do not correspond to a segment) are returned as a hash.
build Construct and return a route with the given path and options.
divide_route_options Split the given hash of options into requirement and default hashes. The segments are passed alongside in order to distinguish between default values and requirements.
ensure_required_segments Makes sure that there are no optional segments that precede a required segment. If any are found that precede a required segment, they are made required.
interval_regexp
new
segment_for A factory method that returns a new segment instance appropriate for the format of the given string.
segments_for_route_path Accepts a "route path" (a string defining a route), and returns the array of segments that corresponds to it. Note that the segment array is only partially initialized—the defaults and requirements, for instance, need to be set separately, via the #assign_route_options method, and the #optional? method for each segment will not be reliable until after #assign_route_options is called, as well.
separator_pattern
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.