Class: AppMap::Handler::Rails::Template::TemplateCall
- Inherits:
-
Event::MethodEvent
- Object
- Struct
- Event::MethodEventStruct
- Event::MethodEvent
- AppMap::Handler::Rails::Template::TemplateCall
- Defined in:
- lib/appmap/handler/rails/template.rb
Overview
TemplateCall is a type of function call which is specialized to view template rendering. Since there isn’t really a perfect method in Rails to hook, this one is synthesized from the available information.
Constant Summary
Constants inherited from Event::MethodEvent
Instance Attribute Summary collapse
-
#path ⇒ Object
Path to the view template.
-
#render_instance ⇒ Object
readonly
This is basically the
self
parameter.
Attributes inherited from Event::MethodEventStruct
Instance Method Summary collapse
-
#initialize(render_instance) ⇒ TemplateCall
constructor
A new instance of TemplateCall.
- #static? ⇒ Boolean
- #to_h ⇒ Object
Methods inherited from Event::MethodEvent
best_class_name, build_from_invocation, custom_display_string, default_display_string, display_string, object_properties
Constructor Details
#initialize(render_instance) ⇒ TemplateCall
Returns a new instance of TemplateCall.
61 62 63 64 65 66 |
# File 'lib/appmap/handler/rails/template.rb', line 61 def initialize(render_instance) super :call AppMap::Event::MethodEvent.build_from_invocation(:call, event: self) @render_instance = render_instance end |
Instance Attribute Details
#path ⇒ Object
Path to the view template.
59 60 61 |
# File 'lib/appmap/handler/rails/template.rb', line 59 def path @path end |
#render_instance ⇒ Object (readonly)
This is basically the self
parameter.
57 58 59 |
# File 'lib/appmap/handler/rails/template.rb', line 57 def render_instance @render_instance end |
Instance Method Details
#static? ⇒ Boolean
68 69 70 |
# File 'lib/appmap/handler/rails/template.rb', line 68 def static? true end |
#to_h ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/appmap/handler/rails/template.rb', line 72 def to_h super.tap do |h| h[:defined_class] = path ? path.parameterize.underscore : 'inline_template' h[:method_id] = 'render' h[:path] = path h[:static] = static? h[:parameters] = [] h[:receiver] = { class: AppMap::Event::MethodEvent.best_class_name(render_instance), object_id: render_instance.__id__, value: AppMap::Event::MethodEvent.display_string(render_instance) } h.compact end end |