Class: SimpleCrowd::Cache::NullStore

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_crowd/cache/null_store.rb

Overview

A cache store implementation which doesn’t actually store anything.

Implements ActiveSupport::Cache::Store interface without depending on the active_support gem.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = nil) ⇒ NullStore

Returns a new instance of NullStore.



12
13
# File 'lib/simple_crowd/cache/null_store.rb', line 12

def initialize(options = nil)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/simple_crowd/cache/null_store.rb', line 9

def options
  @options
end

#silenceObject (readonly) Also known as: silence?

Returns the value of attribute silence.



9
10
11
# File 'lib/simple_crowd/cache/null_store.rb', line 9

def silence
  @silence
end

Class Method Details

.loggerObject



65
66
67
# File 'lib/simple_crowd/cache/null_store.rb', line 65

def self.logger
  nil
end

.logger=(logger) ⇒ Object



69
70
# File 'lib/simple_crowd/cache/null_store.rb', line 69

def self.logger=(logger)
end

Instance Method Details

#cleanup(options = nil) ⇒ Object



53
54
# File 'lib/simple_crowd/cache/null_store.rb', line 53

def cleanup(options = nil)
end

#clear(options = nil) ⇒ Object



50
51
# File 'lib/simple_crowd/cache/null_store.rb', line 50

def clear(options = nil)
end

#decrement(name, amount = 1, options = nil) ⇒ Object



59
60
# File 'lib/simple_crowd/cache/null_store.rb', line 59

def decrement(name, amount = 1, options = nil)
end

#delete(name, options = nil) ⇒ Object



42
43
44
# File 'lib/simple_crowd/cache/null_store.rb', line 42

def delete(name, options = nil)
  false
end

#delete_matched(matcher, options = nil) ⇒ Object



62
63
# File 'lib/simple_crowd/cache/null_store.rb', line 62

def delete_matched(matcher, options = nil)
end

#exist?(name, options = nil) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/simple_crowd/cache/null_store.rb', line 46

def exist?(name, options = nil)
  false
end

#fetch(name, options = nil) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/simple_crowd/cache/null_store.rb', line 26

def fetch(name, options = nil)
  if block_given?
    yield
  else
    read(name, options)
  end
end

#increment(name, amount = 1, options = nil) ⇒ Object



56
57
# File 'lib/simple_crowd/cache/null_store.rb', line 56

def increment(name, amount = 1, options = nil)
end

#muteObject



15
16
17
# File 'lib/simple_crowd/cache/null_store.rb', line 15

def mute
  yield
end

#read(name, options = nil) ⇒ Object



34
35
36
# File 'lib/simple_crowd/cache/null_store.rb', line 34

def read(name, options = nil)
  nil
end

#silence!Object



19
20
# File 'lib/simple_crowd/cache/null_store.rb', line 19

def silence!
end

#synchronizeObject



22
23
24
# File 'lib/simple_crowd/cache/null_store.rb', line 22

def synchronize
  yield
end

#write(name, vaue, options = nil) ⇒ Object



38
39
40
# File 'lib/simple_crowd/cache/null_store.rb', line 38

def write(name, vaue, options = nil)
  true
end