class SlimLint::Filters::AttributeProcessor

A dumbed-down version of {Slim::CodeAttributes} which doesn't introduce any temporary variables or other cruft.

Public Instance Methods

on_html_attr(name, value) click to toggle source

Handle attribute expression `[:html, :attr, name, value]`

@param name [String] name of the attribute @param value [Array] Sexp representing the value

Calls superclass method
# 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) click to toggle source

Handle attributes expression `[:html, :attrs, *attrs]`

@param attrs [Array] @return [Array]

# File lib/slim_lint/filters/attribute_processor.rb, line 13
def on_html_attrs(*attrs)
  [:multi, *attrs.map { |a| compile(a) }]
end