Module: Ukiryu::CacheRegistry
- Defined in:
- lib/ukiryu/cache_registry.rb
Overview
Centralized cache registry for managing all Ukiryu caches.
Provides a single point of control for:
-
Clearing all caches (useful for testing)
-
Getting cache statistics (useful for debugging)
-
Accessing individual caches by name
Class Method Summary collapse
-
.caches ⇒ Array<Cache>
Get all registered caches.
-
.clear_all ⇒ void
Clear all registered caches.
-
.stats ⇒ Hash
Get statistics for all caches.
Class Method Details
.caches ⇒ Array<Cache>
Get all registered caches
23 24 25 26 27 28 |
# File 'lib/ukiryu/cache_registry.rb', line 23 def caches [ ToolCache.cache, Definition::Loader.profile_cache ].compact end |
.clear_all ⇒ void
This method returns an undefined value.
Clear all registered caches
33 34 35 36 |
# File 'lib/ukiryu/cache_registry.rb', line 33 def clear_all caches.each(&:clear) nil end |
.stats ⇒ Hash
Get statistics for all caches
41 42 43 44 45 46 |
# File 'lib/ukiryu/cache_registry.rb', line 41 def stats { tool_cache: cache_stats(ToolCache.cache), definition_cache: cache_stats(Definition::Loader.profile_cache) }.compact end |