class SimpleCache

Public Class Methods

new() click to toggle source
# File lib/simple_cache.rb, line 2
def initialize
  @cache = {}
end

Public Instance Methods

bust() click to toggle source
# File lib/simple_cache.rb, line 10
def bust
  @cache.clear
end
get(key) click to toggle source
# File lib/simple_cache.rb, line 6
def get(key)
  @cache.key?(key) ? @cache[key] : @cache[key] = new_object(key)
end