Sha256: e1d654fef6a05cd7fd4f8e33e538baccc44f5f1cf4509dfc33b50aa71106b616
Contents?: true
Size: 394 Bytes
Versions: 582
Compression:
Stored size: 394 Bytes
Contents
require 'rbbt/tsv' require 'rbbt/persist' module TCCache def self.open(file, type = :single) database = Persist.open_tokyocabinet(file, true, type, "HDB") database.extend TCCache end def cache(key) self.read_and_close do return self[key] if self.include? key end value = yield self.write_and_close do self[key] = value end value end end
Version data entries
582 entries across 582 versions & 1 rubygems