class Fontist::Cache::Manager
Central cache manager for font index caching operations
Public Class Methods
Source
# File lib/fontist/cache/manager.rb, line 12 def cache_dir @cache_dir ||= Fontist.root_path.join("cache") end
Cache directory is determined lazily to avoid initialization issues
Source
# File lib/fontist/cache/manager.rb, line 29 def clear(namespace: nil) return clear_all unless namespace store(namespace).clear end
Source
# File lib/fontist/cache/manager.rb, line 25 def delete(key, namespace: nil) store(namespace).delete(key) end
Source
# File lib/fontist/cache/manager.rb, line 17 def get(key, namespace: nil) store(namespace).get(key) end
Public API for cache operations
Source
# File lib/fontist/cache/manager.rb, line 36 def get_directory_fonts(directory_path) get("directory:#{directory_path}", namespace: :indexes) end
Convenience methods for directory-level caching
Source
# File lib/fontist/cache/manager.rb, line 21 def set(key, value, ttl: nil, namespace: nil) store(namespace).set(key, value, ttl: ttl) end
Source
# File lib/fontist/cache/manager.rb, line 40 def set_directory_fonts(directory_path, fonts) set("directory:#{directory_path}", fonts, ttl: 3600, namespace: :indexes) end