module Tins::Memoize::CacheMethods
Public Instance Methods
Source
# File lib/tins/memoize.rb, line 7 def __memoize_cache__ @__memoize_cache__ ||= {} end
Return the cache object.
Source
# File lib/tins/memoize.rb, line 17 def memoize_apply_visibility(id) visibility = instance_eval do case when private_method_defined?(id) :private when protected_method_defined?(id) :protected end end yield ensure visibility and __send__(visibility, id) end
Source
# File lib/tins/memoize.rb, line 12 def memoize_cache_clear __memoize_cache__.clear self end
Clear cached values for all methods/functions.