Inversion::Template::
AttrTag class
Superclass | Inversion::Template::CodeTag |
Inversion
attribute tag.
Attribute tags add an accessor to a template like ‘attr_accessor’ does for Ruby classes.
Syntax
<?attr foo ?> <?attr "%0.2f" % foo ?>
Attributes
- format RW
the format string used to format the attribute in the template (if one was declared)
- methodchain RW
the chain of methods that should be called (if any).
- name RW
the name of the attribute
Public Class Methods
Create a new AttrTag
with the given ‘name`, which should be a valid Ruby identifier. The `linenum` and `colnum` should be the line and column of the tag in the template source, if available.
Public Instance Methods
Render the tag as the body of a comment, suitable for template debugging.
Evaluate the body of the tag in the context of ‘renderstate` and return the results.
Render the tag attributes of the specified ‘renderstate` and return them.