Module: ActionView::RenderParser::RipperASTParser

Extended by:
RipperASTParser
Included in:
RipperASTParser
Defined in:
actionview/lib/action_view/ripper_ast_parser.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Node, NodeParser, RenderCallExtractor

Instance Method Summary collapse

Instance Method Details

#parse_render_nodes(code) ⇒ Object



188
189
190
191
192
193
194
195
# File 'actionview/lib/action_view/ripper_ast_parser.rb', line 188

def parse_render_nodes(code)
  parser = RenderCallExtractor.new(code)
  parser.parse

  parser.render_calls.group_by(&:first).to_h do |method, nodes|
    [ method.to_sym, nodes.collect { |v| v[1] } ]
  end
end