Class: ActionView::RenderParser::RipperRenderParser::RenderCallExtractor
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
NodeParser ,
Ripper
|
|
Instance Chain:
self,
NodeParser ,
Ripper
|
|
Inherits: |
ActionView::RenderParser::RipperRenderParser::NodeParser
|
Defined in: | actionview/lib/action_view/render_parser/ripper_render_parser.rb |
Constant Summary
-
METHODS_TO_PARSE =
# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 157%w(render render_to_string)
Class Method Summary
- .new(*args) ⇒ RenderCallExtractor constructor
Instance Attribute Summary
- #render_calls readonly
Instance Method Summary
- #on_arg_paren(content) private
- #on_command(name, *args) private
- #on_fcall(name, *args) private
- #on_paren(content) private
- #on_render_call(node) private
Constructor Details
.new(*args) ⇒ RenderCallExtractor
# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 159
def initialize(*args) super @render_calls = [] end
Instance Attribute Details
#render_calls (readonly)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 155
attr_reader :render_calls
Instance Method Details
#on_arg_paren(content) (private)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 184
def on_arg_paren(content) content end
#on_command(name, *args) (private)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 170
def on_command(name, *args) on_render_call(super) end
#on_fcall(name, *args) (private)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 166
def on_fcall(name, *args) on_render_call(super) end
#on_paren(content) (private)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 188
def on_paren(content) content.size == 1 ? content.first : content end
#on_render_call(node) (private)
[ GitHub ]# File 'actionview/lib/action_view/render_parser/ripper_render_parser.rb', line 174
def on_render_call(node) METHODS_TO_PARSE.each do |method| if node.fcall_named?(method) @render_calls << [method, node] return node end end node end