Class: ThemeCheck::HtmlVisitor

Inherits:
Object
  • Object
show all
Defined in:
lib/theme_check/html_visitor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(checks) ⇒ HtmlVisitor

Returns a new instance of HtmlVisitor.



9
10
11
# File 'lib/theme_check/html_visitor.rb', line 9

def initialize(checks)
  @checks = checks
end

Instance Attribute Details

#checksObject (readonly)

Returns the value of attribute checks.



7
8
9
# File 'lib/theme_check/html_visitor.rb', line 7

def checks
  @checks
end

Instance Method Details

#visit_template(template) ⇒ Object



13
14
15
16
17
18
# File 'lib/theme_check/html_visitor.rb', line 13

def visit_template(template)
  doc = parse(template)
  visit(HtmlNode.new(doc, template))
rescue ArgumentError => e
  call_checks(:on_parse_error, e, template)
end