Class: Zache::Fake

Inherits:
Object
  • Object
show all
Defined in:
lib/zache.rb

Overview

Fake implementation that doesn’t cache anything, but behaves like it does. It implements all methods of the original class, but doesn’t do any caching. This is very useful for testing.

Instance Method Summary collapse

Instance Method Details

#cleanObject



66
# File 'lib/zache.rb', line 66

def clean; end

#exists?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/zache.rb', line 52

def exists?(*)
  true
end

#getObject



48
49
50
# File 'lib/zache.rb', line 48

def get(*)
  yield
end

#locked?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/zache.rb', line 56

def locked?
  false
end

#putObject



60
# File 'lib/zache.rb', line 60

def put(*); end

#remove(_key) ⇒ Object



62
# File 'lib/zache.rb', line 62

def remove(_key); end

#remove_allObject



64
# File 'lib/zache.rb', line 64

def remove_all; end

#sizeObject



44
45
46
# File 'lib/zache.rb', line 44

def size
  1
end