Class: PlatformosCheck::UnusedAssign::TemplateInfo
- Inherits:
-
Struct
- Object
- Struct
- PlatformosCheck::UnusedAssign::TemplateInfo
- Defined in:
- lib/platformos_check/checks/unused_assign.rb
Instance Attribute Summary collapse
-
#assign_nodes ⇒ Object
Returns the value of attribute assign_nodes.
-
#includes ⇒ Object
Returns the value of attribute includes.
-
#used_assigns ⇒ Object
Returns the value of attribute used_assigns.
Instance Method Summary collapse
Instance Attribute Details
#assign_nodes ⇒ Object
Returns the value of attribute assign_nodes
17 18 19 |
# File 'lib/platformos_check/checks/unused_assign.rb', line 17 def assign_nodes @assign_nodes end |
#includes ⇒ Object
Returns the value of attribute includes
17 18 19 |
# File 'lib/platformos_check/checks/unused_assign.rb', line 17 def includes @includes end |
#used_assigns ⇒ Object
Returns the value of attribute used_assigns
17 18 19 |
# File 'lib/platformos_check/checks/unused_assign.rb', line 17 def used_assigns @used_assigns end |
Instance Method Details
#collect_used_assigns(templates, visited = Set.new) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/platformos_check/checks/unused_assign.rb', line 18 def collect_used_assigns(templates, visited = Set.new) collected = used_assigns # Check recursively inside included snippets for use includes.each do |name| if templates[name] && !visited.include?(name) visited << name collected += templates[name].collect_used_assigns(templates, visited) end end collected end |