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_ |
Join an array’s elements into a string using " + " as a joiner, and surround string elements in quotes. |
| concat_ |
Concatenate strings and remove regexp end caps |
| count_ |
Count the number of open parentheses in string, up to and including pos |
| default_ |
|
| defer_ |
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_ |
|
| merged_ |
|
| merged_ |
|
| merged_ |
|
| merged_ |
|
| 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_ |
|
| to_ |
|
| to_ |
|
| Protected Methods | |
|---|---|
| ancestors | |
| compiled_ |
def merge_with_ancestors |
| compiled_ |
Compiles the params hash into ‘eval’-able form. |
| copy_ |
|
| deduce_ |
|
| many_ |
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_ |
|
| path_ |
Count the number of regexp captures in the :path condition |
| resource_ |
|
| resources_ |
|
| stringify_ |
Convert conditions to regular expression string sources for consistency |
| total_ |
|
<code/>and<pre/>for code samples.