Class: Moneta::WeakEachKey

Inherits:
Proxy
  • Object
show all
Defined in:
lib/moneta/weak.rb

Overview

Note:

The each_key method hooks into the methods that stores or access the values to collect or discover which keys are valid

Adds weak key enumeration support to the underlying store

so by no means it “knows” the state of the data (this is meant by weak).

Instance Attribute Summary

Attributes inherited from Proxy

#adapter

Instance Method Summary collapse

Methods inherited from Proxy

#clear, #close, #create, #delete, #each_key, #features, features_mask, #fetch_values, #increment, #key?, #load, #merge!, not_supports, #slice, #store, #values_at

Methods included from Defaults

#[], #[]=, #close, #create, #decrement, #each_key, #features, #fetch, #fetch_values, included, #increment, #key?, #merge!, #slice, #supports?, #values_at

Methods included from OptionSupport

#expires, #prefix, #raw, #with

Constructor Details

#initialize(adapter, options = {}) ⇒ WeakEachKey

Returns a new instance of WeakEachKey

Parameters:

  • adapter (Moneta store)

    The underlying store

  • options (Hash) (defaults to: {})

42
43
44
45
# File 'lib/moneta/weak.rb', line 42

def initialize(adapter, options = {})
  raise 'Store already supports feature :each_key' if adapter.supports?(:each_key)
  super
end