Class: ThemeCheck::NestedSnippet::TemplateInfo
- Inherits:
-
Struct
- Object
- Struct
- ThemeCheck::NestedSnippet::TemplateInfo
- Defined in:
- lib/theme_check/checks/nested_snippet.rb
Instance Attribute Summary collapse
-
#includes ⇒ Object
Returns the value of attribute includes.
Instance Method Summary collapse
Instance Attribute Details
#includes ⇒ Object
Returns the value of attribute includes
8 9 10 |
# File 'lib/theme_check/checks/nested_snippet.rb', line 8 def includes @includes end |
Instance Method Details
#with_deep_nested(templates, max, current_level = 0) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/theme_check/checks/nested_snippet.rb', line 9 def with_deep_nested(templates, max, current_level = 0) includes.each do |node| if current_level >= max yield node else template_name = "snippets/#{node.value.template_name_expr}" templates[template_name] &.with_deep_nested(templates, max, current_level + 1) { yield node } end end end |