Sha256: c99c1e49a5e3a9601786266037f3bd0c77166ab89e78e0b9fd738934708fcc1e
Contents?: true
Size: 382 Bytes
Versions: 32
Compression:
Stored size: 382 Bytes
Contents
# # module Helpers module Cache # This is a simple cache. # The store needs to be able to answer to [] and []=. # def cached store, key, &block # Get cached result # results = store[key] return results if results results = lambda(&block).call # Store results # store[key] = results results end end end
Version data entries
32 entries across 32 versions & 1 rubygems