Class: AppMap::Handler::Rails::Template::TemplateMethod
- Inherits:
-
Struct
- Object
- Struct
- AppMap::Handler::Rails::Template::TemplateMethod
- Defined in:
- lib/appmap/handler/rails/template.rb
Overview
All the code which is touched by the AppMap is recorded in the classMap. This duck-typed ‘method’ is used to represent a view template as a package, class, and method in the classMap. The class name is generated from the template path. The package name is ‘app/views’, and the method name is ‘render’. The source location of the method is, of course, the path to the view template.
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #comment ⇒ Object
-
#initialize(path) ⇒ TemplateMethod
constructor
A new instance of TemplateMethod.
- #labels ⇒ Object
- #name ⇒ Object
- #package ⇒ Object
- #source_location ⇒ Object
- #static ⇒ Object
Constructor Details
#initialize(path) ⇒ TemplateMethod
Returns a new instance of TemplateMethod.
21 22 23 24 25 |
# File 'lib/appmap/handler/rails/template.rb', line 21 def initialize(path) super @class_name = path.parameterize.underscore end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
19 20 21 |
# File 'lib/appmap/handler/rails/template.rb', line 19 def class_name @class_name end |
#path ⇒ Object
Returns the value of attribute path
17 18 19 |
# File 'lib/appmap/handler/rails/template.rb', line 17 def path @path end |
Instance Method Details
#comment ⇒ Object
43 44 45 |
# File 'lib/appmap/handler/rails/template.rb', line 43 def comment nil end |
#labels ⇒ Object
47 48 49 |
# File 'lib/appmap/handler/rails/template.rb', line 47 def labels [ 'mvc.template' ] end |
#name ⇒ Object
31 32 33 |
# File 'lib/appmap/handler/rails/template.rb', line 31 def name 'render' end |
#package ⇒ Object
27 28 29 |
# File 'lib/appmap/handler/rails/template.rb', line 27 def package 'app/views' end |
#source_location ⇒ Object
35 36 37 |
# File 'lib/appmap/handler/rails/template.rb', line 35 def source_location path end |
#static ⇒ Object
39 40 41 |
# File 'lib/appmap/handler/rails/template.rb', line 39 def static true end |