Inversion::Template::
RescueTag class
Superclass | Inversion::Template::Tag |
Inversion
‘rescue’ tag.
This tag adds a logical switch to a BeginTag. If rendering any of the BeginTag’s nodes raises an exception of the type specified by the RescueTag
, the nodes following the RescueTag
are rendered instead.
Syntax
<?begin ?> <?for employee in employees.all ?> <?attr employee.name ?> --> <?attr employee.title ?> <?end for?> <?rescue DatabaseError => err ?> Oh no!! I can't talk to the database for some reason. The error was as follows: <?attr err.message ?> <?end?>
Attributes
- exception_types R
The exception classes the rescue will handle (an Array of Class objects)
Public Instance Methods
Parsing callback – check to be sure the node tree can have the ‘rescue’ tag appended to it.
Protected Instance Methods
Overridden to default body to nothing, and raise an error if it has one.