Class: AppMap::Handler::Rails::Template::TemplateMethod

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

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_nameObject (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

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



17
18
19
# File 'lib/appmap/handler/rails/template.rb', line 17

def path
  @path
end

Instance Method Details

#commentObject



43
44
45
# File 'lib/appmap/handler/rails/template.rb', line 43

def comment
  nil
end

#labelsObject



47
48
49
# File 'lib/appmap/handler/rails/template.rb', line 47

def labels
  [ 'mvc.template' ]
end

#nameObject



31
32
33
# File 'lib/appmap/handler/rails/template.rb', line 31

def name
  'render'
end

#packageObject



27
28
29
# File 'lib/appmap/handler/rails/template.rb', line 27

def package
  'app/views'
end

#source_locationObject



35
36
37
# File 'lib/appmap/handler/rails/template.rb', line 35

def source_location
  path
end

#staticObject



39
40
41
# File 'lib/appmap/handler/rails/template.rb', line 39

def static
  true
end