Module: TemplateRenderer::ClassMethods
- Defined in:
- lib/generators/template_renderer.rb
Overview
Class methods added to the including class
Instance Method Summary collapse
-
#clear_template_cache ⇒ Object
Clear the template cache (useful for testing).
-
#template_cache_stats ⇒ Object
Get cache statistics (useful for debugging).
-
#template_renderer ⇒ Object
Get the shared template renderer instance Each generator class gets its own cache instance.
Instance Method Details
#clear_template_cache ⇒ Object
Clear the template cache (useful for testing)
80 81 82 83 |
# File 'lib/generators/template_renderer.rb', line 80 def clear_template_cache @template_renderer&.clear @template_renderer = nil end |
#template_cache_stats ⇒ Object
Get cache statistics (useful for debugging)
86 87 88 |
# File 'lib/generators/template_renderer.rb', line 86 def template_cache_stats @template_renderer&.stats || { size: 0, entries: [], memory_estimate: 0 } end |
#template_renderer ⇒ Object
Get the shared template renderer instance Each generator class gets its own cache instance
75 76 77 |
# File 'lib/generators/template_renderer.rb', line 75 def template_renderer @template_renderer ||= PartialCache.new(self) end |