Accept the node that is being passed in the position of the template and
return the template name and whether or not it is an object template.
# File actionview/lib/action_view/render_parser/prism_render_parser.rb, line 97
def render_call_template(node)
object_template = false
template =
if node.is_a?(Prism::StringNode)
path = node.unescaped
path.include?("/") ? path : "#{directory}/#{path}"
else
dependency =
case node.type
when :class_variable_read_node
node.slice[2..]
when :instance_variable_read_node
node.slice[1..]
when :global_variable_read_node
node.slice[1..]
when :local_variable_read_node
node.slice
when :call_node
node.name.to_s
else
return
end
"#{dependency.pluralize}/#{dependency.singularize}"
end
[template, object_template]
end