Class: APICache::AbstractStore

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

Direct Known Subclasses

MemcacheStore, MemoryStore

Instance Method Summary collapse

Constructor Details

#initializeAbstractStore



2
3
4
# File 'lib/api_cache/abstract_store.rb', line 2

def initialize
  raise "Method not implemented. Called abstract class."
end

Instance Method Details

#exists?(key) ⇒ Boolean

Does a given key exist in the cache?



17
18
19
# File 'lib/api_cache/abstract_store.rb', line 17

def exists?(key)
  raise "Method not implemented. Called abstract class."
end

#expired?(key, timeout) ⇒ Boolean

Has a given time passed since the key was set?



22
23
24
# File 'lib/api_cache/abstract_store.rb', line 22

def expired?(key, timeout)
  raise "Method not implemented. Called abstract class."
end

#get(key) ⇒ Object

Get value.



12
13
14
# File 'lib/api_cache/abstract_store.rb', line 12

def get(key)
  raise "Method not implemented. Called abstract class."
end

#set(key, value) ⇒ Object

Set value. Returns true if success.



7
8
9
# File 'lib/api_cache/abstract_store.rb', line 7

def set(key, value)
  raise "Method not implemented. Called abstract class."
end