class HamlLint::NodeTransformer
that linters don’t have to deal with them.
would expect. This class is intended to isolate and handle these cases so
types of nodes are created that don’t necessarily correspond to what one
The parse tree generated by HAML has a number of strange cases where certain
corresponding {HamlLint::Tree::Node} objects.
Responsible for transforming {Haml::Parser::ParseNode} objects into
def initialize(document)
-
document
(HamlLint::Document
) --
def initialize(document) @document = document end
def transform(haml_node)
-
(HamlLint::Tree::Node)
-
Parameters:
-
haml_node
(Haml::Parser::ParseNode
) --
def transform(haml_node) node_class = "#{HamlLint::Utils.camel_case(haml_node.type.to_s)}Node" HamlLint::Tree.const_get(node_class).new(@document, haml_node) end