Class: APICache::AbstractStore

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

Direct Known Subclasses

DalliStore, MemoryStore, MonetaStore, NullStore

Instance Method Summary (collapse)

Constructor Details

- (AbstractStore) initialize

Returns a new instance of AbstractStore



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

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

Instance Method Details

- (Object) delete(key)

Delete value.



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

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

- (Boolean) exists?(key)

Does a given key exist in the cache?

Returns:

  • (Boolean)


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

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

- (Boolean) expired?(key, timeout)

Has a given time passed since the key was set?

Returns:

  • (Boolean)


28
29
30
# File 'lib/api_cache/abstract_store.rb', line 28

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

- (Object) get(key)

Get value.



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

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

- (Object) set(key, value)

Set value. Returns true if success.



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

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