Class: Moneta::WeakIncrement

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

Overview

Note:

The increment method will not be thread or multi-process safe (this is meant by weak)

Adds weak increment support to the underlying store

Instance Attribute Summary

Attributes inherited from Proxy

#adapter

Instance Method Summary collapse

Methods included from IncrementSupport

included, #increment

Methods inherited from Proxy

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

Methods included from Config

#config, included

Methods included from Defaults

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

Methods included from OptionSupport

#expires, #prefix, #raw, #with

Constructor Details

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

Returns a new instance of WeakIncrement.

Parameters:

  • adapter (Moneta store)

    The underlying store

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


26
27
28
29
# File 'lib/moneta/weak.rb', line 26

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