Class: Moneta::Wrapper
Overview
Wraps the calls to the adapter
Direct Known Subclasses
Fallback, Lock, Logger, OptionMerger, Pool, Shared, WeakEachKey
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
-
#clear(options = {}) ⇒ void
Clear all keys in this store.
- #close ⇒ Object
-
#config ⇒ Object
Overrides the default implementation of the config method to:.
- #create(key, value, options = {}) ⇒ Object
-
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value.
- #each_key(&block) ⇒ Object
- #features ⇒ Object
- #fetch_values(*keys, **options, &defaults) ⇒ Object
- #increment(key, amount = 1, options = {}) ⇒ Object
- #key?(key, options = {}) ⇒ Boolean
-
#load(key, options = {}) ⇒ Object
Fetch value with key.
- #merge!(pairs, options = {}) ⇒ Object
- #slice(*keys, **options) ⇒ Object
-
#store(key, value, options = {}) ⇒ Object
Store value with key.
- #values_at(*keys, **options) ⇒ Object
Methods inherited from Proxy
features_mask, #initialize, not_supports
Methods included from Config
Methods included from Defaults
#[], #[]=, #decrement, #fetch, included, #supports?, #update
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
This class inherits a constructor from Moneta::Proxy
Instance Method Details
#clear(options = {}) ⇒ void
This method returns an undefined value.
Clear all keys in this store
36 37 38 |
# File 'lib/moneta/wrapper.rb', line 36 def clear( = {}) wrap(:clear, ) { super } end |
#close ⇒ Object
41 42 43 |
# File 'lib/moneta/wrapper.rb', line 41 def close wrap(:close) { super } end |
#config ⇒ Object
Overrides the default implementation of the config method to:
-
pass the adapter’s config, if this proxy has no configuration of its own
-
return a merged configuration, allowing the proxy have precedence over the adapter
76 77 78 |
# File 'lib/moneta/wrapper.rb', line 76 def config wrap(:config) { super } end |
#create(key, value, options = {}) ⇒ Object
31 32 33 |
# File 'lib/moneta/wrapper.rb', line 31 def create(key, value, = {}) wrap(:create, key, value, ) { super } end |
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value
21 22 23 |
# File 'lib/moneta/wrapper.rb', line 21 def delete(key, = {}) wrap(:delete, key, ) { super } end |
#each_key(&block) ⇒ Object
51 52 53 |
# File 'lib/moneta/wrapper.rb', line 51 def each_key(&block) wrap(:each_key) { super } end |
#features ⇒ Object
46 47 48 |
# File 'lib/moneta/wrapper.rb', line 46 def features wrap(:features) { super } end |
#fetch_values(*keys, **options, &defaults) ⇒ Object
61 62 63 |
# File 'lib/moneta/wrapper.rb', line 61 def fetch_values(*keys, **, &defaults) wrap(:fetch_values, keys, , defaults) { super } end |
#increment(key, amount = 1, options = {}) ⇒ Object
26 27 28 |
# File 'lib/moneta/wrapper.rb', line 26 def increment(key, amount = 1, = {}) wrap(:increment, key, amount, ) { super } end |
#key?(key, options = {}) ⇒ Boolean
6 7 8 |
# File 'lib/moneta/wrapper.rb', line 6 def key?(key, = {}) wrap(:key?, key, ) { super } end |
#load(key, options = {}) ⇒ Object
Fetch value with key. Return nil if the key doesn’t exist
11 12 13 |
# File 'lib/moneta/wrapper.rb', line 11 def load(key, = {}) wrap(:load, key, ) { super } end |
#merge!(pairs, options = {}) ⇒ Object
71 72 73 |
# File 'lib/moneta/wrapper.rb', line 71 def merge!(pairs, = {}) wrap(:merge!, pairs, ) { super } end |
#slice(*keys, **options) ⇒ Object
66 67 68 |
# File 'lib/moneta/wrapper.rb', line 66 def slice(*keys, **) wrap(:slice, keys, ) { super } end |
#store(key, value, options = {}) ⇒ Object
Store value with key
16 17 18 |
# File 'lib/moneta/wrapper.rb', line 16 def store(key, value, = {}) wrap(:store, key, value, ) { super } end |
#values_at(*keys, **options) ⇒ Object
56 57 58 |
# File 'lib/moneta/wrapper.rb', line 56 def values_at(*keys, **) wrap(:values_at, keys, ) { super } end |