Class: Brakeman::Template
- Inherits:
-
Collection
- Object
- Collection
- Brakeman::Template
- Defined in:
- lib/brakeman/tracker/template.rb
Instance Attribute Summary collapse
-
#render_path ⇒ Object
readonly
Returns the value of attribute render_path.
-
#src ⇒ Object
writeonly
Sets the attribute src.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #add_output(exp) ⇒ Object
- #each_output ⇒ Object
-
#initialize(name, called_from, file_name, tracker) ⇒ Template
constructor
A new instance of Template.
- #rendered_from_controller? ⇒ Boolean
Constructor Details
#initialize(name, called_from, file_name, tracker) ⇒ Template
Returns a new instance of Template.
9 10 11 12 13 |
# File 'lib/brakeman/tracker/template.rb', line 9 def initialize name, called_from, file_name, tracker super name, nil, file_name, nil, tracker @render_path = called_from @outputs = [] end |
Instance Attribute Details
#render_path ⇒ Object (readonly)
Returns the value of attribute render_path.
6 7 8 |
# File 'lib/brakeman/tracker/template.rb', line 6 def render_path @render_path end |
#src=(value) ⇒ Object (writeonly)
Sets the attribute src
7 8 9 |
# File 'lib/brakeman/tracker/template.rb', line 7 def src=(value) @src = value end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/brakeman/tracker/template.rb', line 5 def type @type end |
Instance Method Details
#add_output(exp) ⇒ Object
15 16 17 |
# File 'lib/brakeman/tracker/template.rb', line 15 def add_output exp @outputs << exp end |
#each_output ⇒ Object
19 20 21 22 23 |
# File 'lib/brakeman/tracker/template.rb', line 19 def each_output @outputs.each do |o| yield o end end |
#rendered_from_controller? ⇒ Boolean
25 26 27 28 29 30 31 |
# File 'lib/brakeman/tracker/template.rb', line 25 def rendered_from_controller? if @render_path @render_path.rendered_from_controller? else false end end |