Class: SlimLint::Filters::AttributeProcessor
- Inherits:
-
Slim::Filter
- Object
- Slim::Filter
- SlimLint::Filters::AttributeProcessor
- Defined in:
- lib/slim_lint/filters/attribute_processor.rb
Overview
A dumbed-down version of Slim::CodeAttributes which doesn’t introduce any temporary variables or other cruft.
Instance Method Summary collapse
-
#on_html_attr(name, value) ⇒ Object
Handle attribute expression ‘[:html, :attr, name, value]`.
-
#on_html_attrs(*attrs) ⇒ Array
Handle attributes expression ‘[:html, :attrs, *attrs]`.
Instance Method Details
#on_html_attr(name, value) ⇒ Object
Handle attribute expression ‘[:html, :attr, name, value]`
21 22 23 24 25 26 27 28 29 |
# File 'lib/slim_lint/filters/attribute_processor.rb', line 21 def on_html_attr(name, value) if value[0] == :slim && value[1] == :attrvalue code = value[3] [:code, code] else @attr = name super end end |
#on_html_attrs(*attrs) ⇒ Array
Handle attributes expression ‘[:html, :attrs, *attrs]`
13 14 15 |
# File 'lib/slim_lint/filters/attribute_processor.rb', line 13 def on_html_attrs(*attrs) [:multi, *attrs.map { |a| compile(a) }] end |