Class: ActionView::RenderParser::PrismRenderParser
- Defined in:
- lib/action_view/render_parser/prism_render_parser.rb
Overview
:nodoc:
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from ActionView::RenderParser::Base
Instance Method Details
#render_calls ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/action_view/render_parser/prism_render_parser.rb', line 6 def render_calls queue = [Prism.parse(@code).value] templates = [] while (node = queue.shift) queue.concat(node.compact_child_nodes) next unless node.is_a?(Prism::CallNode) = (node) next unless render_type = (.keys & RENDER_TYPE_KEYS)[0] template, object_template = render_call_template([render_type]) next unless template if .key?(:object) || .key?(:collection) || object_template next if .key?(:object) && .key?(:collection) next unless .key?(:partial) end if [:spacer_template].is_a?(Prism::StringNode) templates << partial_to_virtual_path(:partial, [:spacer_template].unescaped) end templates << partial_to_virtual_path(render_type, template) if render_type != :layout && [:layout].is_a?(Prism::StringNode) templates << partial_to_virtual_path(:layout, [:layout].unescaped) end end templates end |