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]`
19 20 21 22 23 24 25 26 27 |
# File 'lib/slim_lint/filters/attribute_processor.rb', line 19 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]`
11 12 13 |
# File 'lib/slim_lint/filters/attribute_processor.rb', line 11 def on_html_attrs(*attrs) [:multi, *attrs.map { |a| compile(a) }] end |