module Fontist::Memoizable
Public Class Methods
Source
# File lib/fontist/memoizable.rb, line 3 def self.included(base) base.extend(ClassMethods) end
Public Instance Methods
Source
# File lib/fontist/memoizable.rb, line 21 def clear_memo_cache # Clear all tracked cache keys from disk and memory @memo_cache_keys&.each do |key| Fontist::Cache::Manager.delete(key) end @memo_cache = {} @memo_cache_keys = Set.new end
Source
# File lib/fontist/memoizable.rb, line 8 def generate_memo_cache_key(method_name, args, key_proc) if key_proc key_proc.call(*args) else "#{method_name}:#{args.hash}" end end
Instance methods for memoization support
Source
# File lib/fontist/memoizable.rb, line 16 def memo_cache_expired?(_cached) # Cache::Manager handles TTL internally false end