Class: Moneta::Adapters::Null

Inherits:
Base
  • Object
show all
Defined in:
lib/moneta/adapters/null.rb

Overview

Null backend which doesn’t store anything

Instance Method Summary collapse

Methods inherited from Base

#[], #[]=, #close, #decrement, #fetch, #increment

Methods included from Mixins::WithOptions

#expires, #prefix, #raw, #with

Constructor Details

#initialize(options = {}) ⇒ Null

Returns a new instance of Null.



6
7
# File 'lib/moneta/adapters/null.rb', line 6

def initialize(options = {})
end

Instance Method Details

#clear(options = {}) ⇒ Object



25
26
27
# File 'lib/moneta/adapters/null.rb', line 25

def clear(options = {})
  self
end

#delete(key, options = {}) ⇒ Object



21
22
23
# File 'lib/moneta/adapters/null.rb', line 21

def delete(key, options = {})
  nil
end

#key?(key, options = {}) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/moneta/adapters/null.rb', line 9

def key?(key, options = {})
  false
end

#load(key, options = {}) ⇒ Object



13
14
15
# File 'lib/moneta/adapters/null.rb', line 13

def load(key, options = {})
  nil
end

#store(key, value, options = {}) ⇒ Object



17
18
19
# File 'lib/moneta/adapters/null.rb', line 17

def store(key, value, options = {})
  value
end