Class: ActionviewPrecompiler::SyntaxTreeASTParser::RenderVisitor
- Inherits:
-
SyntaxTree::Visitor
- Object
- SyntaxTree::Visitor
- ActionviewPrecompiler::SyntaxTreeASTParser::RenderVisitor
- 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
-
#render_calls ⇒ Object
readonly
Returns the value of attribute render_calls.
Instance Method Summary collapse
-
#initialize ⇒ RenderVisitor
constructor
A new instance of RenderVisitor.
Constructor Details
#initialize ⇒ RenderVisitor
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_calls ⇒ Object (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 |