Class: 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
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #comment ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
- #id ⇒ 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.
24 25 26 27 28 |
# File 'lib/appmap/handler/rails/template.rb', line 24 def initialize(path) @path = path @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 (readonly)
Returns the value of attribute path.
21 22 23 |
# File 'lib/appmap/handler/rails/template.rb', line 21 def path @path end |
Instance Method Details
#comment ⇒ Object
58 59 60 |
# File 'lib/appmap/handler/rails/template.rb', line 58 def comment nil end |
#eql?(other) ⇒ Boolean
38 39 40 |
# File 'lib/appmap/handler/rails/template.rb', line 38 def eql?(other) other.is_a?(TemplateMethod) && id.eql?(other.id) end |
#hash ⇒ Object
34 35 36 |
# File 'lib/appmap/handler/rails/template.rb', line 34 def hash id.hash end |
#id ⇒ Object
30 31 32 |
# File 'lib/appmap/handler/rails/template.rb', line 30 def id [ package, path, name ] end |
#labels ⇒ Object
62 63 64 |
# File 'lib/appmap/handler/rails/template.rb', line 62 def labels [ 'mvc.template' ] end |
#name ⇒ Object
46 47 48 |
# File 'lib/appmap/handler/rails/template.rb', line 46 def name 'render' end |
#package ⇒ Object
42 43 44 |
# File 'lib/appmap/handler/rails/template.rb', line 42 def package 'app/views' end |
#source_location ⇒ Object
50 51 52 |
# File 'lib/appmap/handler/rails/template.rb', line 50 def source_location path end |
#static ⇒ Object
54 55 56 |
# File 'lib/appmap/handler/rails/template.rb', line 54 def static true end |