Class: ViewParser

Inherits:
Object show all
Defined in:
lib/volt/server/html_parser/view_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html, template_path) ⇒ ViewParser

Returns a new instance of ViewParser.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/volt/server/html_parser/view_parser.rb', line 11

def initialize(html, template_path)
  @template_path = template_path

  handler = ViewHandler.new(template_path)
  
  SandlebarsParser.new(html, handler)
  
  # Close out the last scope
  handler.scope.last.close_scope
  
  @templates = handler.templates
end

Instance Attribute Details

#templatesObject (readonly)

Returns the value of attribute templates.



9
10
11
# File 'lib/volt/server/html_parser/view_parser.rb', line 9

def templates
  @templates
end