Class Merb::Router::Route
In: lib/merb-core/dispatch/router/route.rb
Parent: Object

Methods

Attributes

behavior  [R] 
conditional_block  [R] 
conditions  [R] 
index  [R] 
params  [R] 
segments  [R] 
symbol  [R] 

Public Class methods

Parameters

conditions<Hash>:Conditions for the route.
params<Hash>:Parameters for the route.
behavior<Merb::Router::Behavior>:The associated behavior. Defaults to nil.
&conditional_block:A block with the conditions to be met for the route to take effect.

Public Instance methods

Returns

Boolean:True if fixation is allowed.

Prints a trace of the behavior for this route.

Compiles the route to a form used by Merb::Router.

Parameters

first<Boolean>:True if this is the first route in set of routes. Defaults to false.

Returns

String:The code corresponding to the route in a form suited for eval.

Parameters

enabled<Boolean>:True enables fixation on the route.

Parameters

params<Hash>:Optional parameters for the route.
fallback<Hash>:Optional parameters for the fallback route.

Returns

String:The URL corresponding to the params, using the stored route segments for reconstruction of the URL.

Params

params_as_string<String>:The params hash as a string, e.g. ":foo => ‘bar’".

Returns

Array:All the conditions as eval‘able strings.

Names this route in Router.

Parameters

symbol<Symbol>:The name of the route.

Raises

ArgumentError:symbol is not a Symbol.

Returns

Boolean:True if this route is a regexp, i.e. its behavior or one of the behavior‘s ancestors is a regexp.

Registers the route in the Router.routes array.

Turn a path into string and symbol segments so it can be reconstructed, as in the case of a named route.

Parameters

path<String>:The path to split into segments.

Returns

Array:The Symbol and String segments for the path.

Returns

Array:All the symbols in the segments array.

Returns

String:The route as a string, e.g. "admin/:controller/:id".

[Validate]