Class: Moneta::Adapters::Null
- Inherits:
-
Object
- Object
- Moneta::Adapters::Null
- Includes:
- Defaults
- Defined in:
- lib/moneta/adapters/null.rb
Overview
Null backend which doesn’t store anything
Instance Method Summary collapse
-
#clear(options = {}) ⇒ void
Clear all keys in this store.
-
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value.
-
#initialize(options = {}) ⇒ Null
constructor
A new instance of Null.
-
#key?(key, options = {}) ⇒ Boolean
Exists the value with key.
-
#load(key, options = {}) ⇒ Object
Fetch value with key.
-
#store(key, value, options = {}) ⇒ Object
Store value with key.
Methods included from Defaults
#[], #[]=, #close, #create, #decrement, #features, #fetch, included, #increment, #supports?
Methods included from OptionSupport
#expires, #prefix, #raw, #with
Constructor Details
#initialize(options = {}) ⇒ Null
Returns a new instance of Null.
9 10 |
# File 'lib/moneta/adapters/null.rb', line 9 def initialize( = {}) end |
Instance Method Details
#clear(options = {}) ⇒ void
This method returns an undefined value.
Clear all keys in this store
33 34 35 |
# File 'lib/moneta/adapters/null.rb', line 33 def clear( = {}) self end |
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value
28 29 30 |
# File 'lib/moneta/adapters/null.rb', line 28 def delete(key, = {}) nil end |
#key?(key, options = {}) ⇒ Boolean
Exists the value with key
13 14 15 |
# File 'lib/moneta/adapters/null.rb', line 13 def key?(key, = {}) false end |
#load(key, options = {}) ⇒ Object
Fetch value with key. Return nil if the key doesn’t exist
18 19 20 |
# File 'lib/moneta/adapters/null.rb', line 18 def load(key, = {}) nil end |
#store(key, value, options = {}) ⇒ Object
Store value with key
23 24 25 |
# File 'lib/moneta/adapters/null.rb', line 23 def store(key, value, = {}) value end |