Inversion::Template::
ForTag class
Superclass | Inversion::Template::CodeTag |
Included Modules |
Inversion
‘for’ tag.
Iteration tag for outputting a template part for each member of a collection (i.e., an object that is Enumerable).
Syntax
<?for var in attribute ?> <?for var in attribute.methodchain ?> <?for var1, var2 in attribute.methodchain ?>
Examples
<?for employee in company.employees ?> Hey <?call employee.name ?>! You're fired! <?end ?>
Attributes
- block_args RW
The array of attribute names that will be assigned to the rendering scope by the block for each iteration
- enumerator RW
The attribute or methodchain that yields the enumerable object
Public Class Methods
Create a new ForTag
with the specified ‘body`.
Public Instance Methods
Render the tag as the body of a comment, suitable for template debugging.
Iterate over the enumerator in ‘state` and render the tag’s contents for each iteration.