Class

Behavior

Extends:

The Behavior class is an interim route-building class that ties pattern-matching conditions to output parameters, params.

Public Attributes
conditions
params
parent
placeholders
Public Methods
add
array_to_code Join an array’s elements into a string using " + " as a joiner, and surround string elements in quotes.
concat_without_endcaps Concatenate strings and remove regexp end caps
count_parens_up_to Count the number of open parentheses in string, up to and including pos
default_routes
defer_to Takes a block and stores it for defered conditional routes. The block takes the request object and the params hash as parameters and should return a hash of params.
inspect
match Matches a path and any number of optional request methods as conditions of a route. Alternatively, path can be a hash of conditions, in which case conditions is ignored. Yields a new instance so that sub-matching may occur.
match_without_path
merged_conditions
merged_original_conditions
merged_params
merged_placeholders
namespace
new
regexp?
resource
resources
to Creates a Route from one or more Behavior objects, unless a block is passed in. If a block is passed in, a Behavior object is yielded and further .to operations may be called in the block. For example:
to_resource
to_resources
to_route
Protected Methods
ancestors
compiled_conditions def merge_with_ancestors
compiled_params Compiles the params hash into ‘eval’-able form.
copy_original_conditions
deduce_placeholders
many_behaviors_to Creates a series of routes from an array of Behavior objects. You can pass in optional params, and an optional block that will be passed along to the #to method.
namespace_to_name_prefix
path_captures Count the number of regexp captures in the :path condition
resource_behaviors
resources_behaviors
stringify_conditions Convert conditions to regular expression string sources for consistency
total_previous_captures
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.