Sha256: 0f6980aca75abf1bbcc538de3fde22c9e92fd5f597e4ca73d73c5d8b8cccbc2f
Contents?: true
Size: 772 Bytes
Versions: 6
Compression:
Stored size: 772 Bytes
Contents
class Figgy # The backing object for a {Figgy} instance. class Store def initialize(finder, config) @finder = finder @config = config @cache = {} end # Retrieve the value for a key, expiring the cache and/or loading it # if necessary. # # @raise [Figgy::FileNotFound] if no config file could be found for +name+ def get(key) key = key.to_s @cache.delete(key) if @config.always_reload? if @cache.key?(key) @cache[key] else @cache[key] = @finder.load(key) end end # @return [Array<String>] the list of currently loaded keys def keys @cache.keys end # @return [Integer] the current size of the cache def size @cache.size end end end
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
figgy-1.3.0 | lib/figgy/store.rb |
figgy-1.2.0 | lib/figgy/store.rb |
figgy-1.1.0 | lib/figgy/store.rb |
figgy-1.0.0 | lib/figgy/store.rb |
figgy-0.9.1 | lib/figgy/store.rb |
figgy-0.9.0 | lib/figgy/store.rb |