Class: ThemeCheck::Visitor

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(checks, disabled_checks) ⇒ Visitor

Returns a new instance of Visitor.



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

def initialize(checks, disabled_checks)
  @checks = checks
  @disabled_checks = disabled_checks
end

Instance Attribute Details

#checksObject (readonly)

Returns the value of attribute checks.



4
5
6
# File 'lib/theme_check/visitor.rb', line 4

def checks
  @checks
end

Instance Method Details

#visit_template(template) ⇒ Object



11
12
13
14
15
16
# File 'lib/theme_check/visitor.rb', line 11

def visit_template(template)
  visit(Node.new(template.root, nil, template))
rescue Liquid::Error => exception
  exception.template_name = template.name
  call_checks(:on_error, exception)
end