Module: ActionviewPrecompiler::RipperASTParser

Extended by:
RipperASTParser
Included in:
RipperASTParser
Defined in:
lib/actionview_precompiler/ast_parser/ripper.rb

Defined Under Namespace

Classes: Node, NodeParser, RenderCallParser

Instance Method Summary collapse

Instance Method Details

#parse_render_nodes(code) ⇒ Object



197
198
199
200
201
202
203
204
# File 'lib/actionview_precompiler/ast_parser/ripper.rb', line 197

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

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