Class: ActionviewPrecompiler::SyntaxTreeASTParser::RenderVisitor

Inherits:
SyntaxTree::Visitor
  • Object
show all
Defined in:
lib/actionview_precompiler/ast_parser/syntax_tree.rb

Overview

This visitor is responsible for visiting the parsed tree and extracting out the render calls. After visiting the tree, the #render_calls method will return the hash expected by the #parse_render_nodes method.

Constant Summary collapse

MESSAGE =
/\A(render|render_to_string|layout)\z/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRenderVisitor

Returns a new instance of RenderVisitor.



114
115
116
# File 'lib/actionview_precompiler/ast_parser/syntax_tree.rb', line 114

def initialize
  @render_calls = Hash.new { |hash, key| hash[key] = [] }
end

Instance Attribute Details

#render_callsObject (readonly)

Returns the value of attribute render_calls.



112
113
114
# File 'lib/actionview_precompiler/ast_parser/syntax_tree.rb', line 112

def render_calls
  @render_calls
end