Class: HamlLint::ParsedRuby

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/haml_lint/parsed_ruby.rb

Overview

A thin wrapper around the syntax tree from the Parser gem.

Instance Method Summary collapse

Instance Method Details

#contains_instance_variables?true, false

Checks whether the syntax tree contains any instance variables.

Returns:

  • (true, false)


18
19
20
21
22
# File 'lib/haml_lint/parsed_ruby.rb', line 18

def contains_instance_variables?
  return false unless syntax_tree

  syntax_tree.ivar_type? || syntax_tree.each_descendant.any?(&:ivar_type?)
end