Sha256: 661b79309b1ac14cae2c95d7ab56ebf7db35e88f05d3d36526d199e2fbc11ff0
Contents?: true
Size: 693 Bytes
Versions: 4
Compression:
Stored size: 693 Bytes
Contents
require 'forwardable' module Yoda module Store module Adapters class LazyAdapter < Base class << self def for(path, type) @pool ||= {} @pool[path] || (@pool[path] = new(path)) end def type :lazy end end extend Forwardable delegate %i(get put delete exist keys stats sync clear batch_write) => :adapter # @param path [String] represents the path to store db. def initialize(path) @path = path end # @return [Adapters::Base] def adapter @adapter ||= Adapters.for(path) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems