Class: APICache::AbstractStore
- Inherits:
-
Object
- Object
- APICache::AbstractStore
- Defined in:
- lib/api_cache/abstract_store.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#exists?(key) ⇒ Boolean
Does a given key exist in the cache?.
-
#expired?(key, timeout) ⇒ Boolean
Has a given time passed since the key was set?.
-
#get(key) ⇒ Object
Get value.
-
#initialize ⇒ AbstractStore
constructor
A new instance of AbstractStore.
-
#set(key, value) ⇒ Object
Set value.
Constructor Details
#initialize ⇒ AbstractStore
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
#exists?(key) ⇒ Boolean
Does a given key exist in the cache?
18 19 20 |
# File 'lib/api_cache/abstract_store.rb', line 18 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?
23 24 25 |
# File 'lib/api_cache/abstract_store.rb', line 23 def expired?(key, timeout) raise "Method not implemented. Called abstract class." end |
#get(key) ⇒ Object
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 |
#set(key, value) ⇒ Object
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 |