Sha256: baed3f0848272b5b236c18a17bfa369c18ba8f9b1950ce3a25bc13a1a301c72e
Contents?: true
Size: 769 Bytes
Versions: 11
Compression:
Stored size: 769 Bytes
Contents
require 'localmemcache' module Moneta module Adapters # LocalMemCache backend # @api public class LocalMemCache include Defaults include HashAdapter # @param [Hash] options # @option options [String] :file Database file # @option options [::LocalMemCache] :backend Use existing backend instance def initialize(options = {}) @backend = options[:backend] || begin raise ArgumentError, 'Option :file is required' unless options[:file] ::LocalMemCache.new(:filename => options[:file]) end end # (see Proxy#delete) def delete(key, options = {}) value = load(key, options) @backend.delete(key) value end end end end
Version data entries
11 entries across 11 versions & 1 rubygems