class HamlLint::Tree::RootNode

Represents the root node of a HAML document that contains all other nodes.

Public Instance Methods

file() click to toggle source

The name fo the file parsed to build this tree.

@return [String] a file name

# File lib/haml_lint/tree/root_node.rb, line 10
def file
  @document.file
end
node_for_line(line) click to toggle source

Gets the node of the syntax tree for a given line number.

@param line [Integer] the line number of the node @return [HamlLint::Node]

# File lib/haml_lint/tree/root_node.rb, line 18
def node_for_line(line)
  find(-> { HamlLint::Tree::NullNode.new }) do |node|
    node.line_numbers.cover?(line) && node != self
  end
end