module CollinsShell::Console::Cache

Public Instance Methods

cache_get_or_else(key, &block) click to toggle source
# File lib/collins_shell/console/cache.rb, line 9
def cache_get_or_else key, &block
  if @@_cache[key].nil? then
    @@_cache[key] = block.call
  else
    @@_cache[key]
  end
end
clear_cache() click to toggle source
# File lib/collins_shell/console/cache.rb, line 5
def clear_cache
  @@_cache = {}
end