class Zipcoder::Cacher::Memory
Public Instance Methods
_empty_cache()
click to toggle source
# File lib/zipcoder/cacher/memory.rb, line 10 def _empty_cache @cache.clear end
_init_cache(**kwargs)
click to toggle source
# File lib/zipcoder/cacher/memory.rb, line 6 def _init_cache(**kwargs) @cache = {} end
_iterate_keys(**kwargs, &block)
click to toggle source
# File lib/zipcoder/cacher/memory.rb, line 22 def _iterate_keys(**kwargs, &block) return if block == nil start_with = kwargs[:start_with] @cache.keys.each do |key| if start_with == nil or key.start_with?(start_with) block.call(key) end end end
_read_cache(key)
click to toggle source
# File lib/zipcoder/cacher/memory.rb, line 18 def _read_cache(key) @cache[key] end
_write_cache(key, value)
click to toggle source
# File lib/zipcoder/cacher/memory.rb, line 14 def _write_cache(key, value) @cache[key] = value end