Class: ActionView::RenderParser::RipperRenderParser

Inherits:
Base
  • Object
show all
Defined in:
lib/action_view/render_parser/ripper_render_parser.rb

Overview

:nodoc:

Defined Under Namespace

Classes: Node, NodeParser, RenderCallExtractor

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ActionView::RenderParser::Base

Instance Method Details

#render_callsObject



184
185
186
187
188
189
190
191
192
193
# File 'lib/action_view/render_parser/ripper_render_parser.rb', line 184

def render_calls
  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.map do |method, nodes|
    nodes.map { |n| parse_render(n) }
  end.flatten.compact
end