Class: Elephas::Backends::Base
- Inherits:
-
Object
- Object
- Elephas::Backends::Base
- Includes:
- Lazier::I18n
- Defined in:
- lib/elephas/backends/base.rb
Overview
The a base backend. All data-related methods must be overriden.
Direct Known Subclasses
Instance Method Summary collapse
-
#delete(key) ⇒ TrueClass|FalseClass
Deletes a value from the cache.
-
#exists?(key) ⇒ TrueClass|FalseClass
Checks if a key exists in the cache.
-
#now ⇒ Object
Returns the current time for comparing with entries TTL.
-
#read(key) ⇒ Entry|NilClass
Reads a value from the cache.
-
#write(key, value, options = {}) ⇒ Object
Writes a value to the cache.
Instance Method Details
#delete(key) ⇒ TrueClass|FalseClass
Deletes a value from the cache.
37 38 39 |
# File 'lib/elephas/backends/base.rb', line 37 def delete(key) unimplemented end |
#exists?(key) ⇒ TrueClass|FalseClass
Checks if a key exists in the cache.
45 46 47 |
# File 'lib/elephas/backends/base.rb', line 45 def exists?(key) unimplemented end |
#now ⇒ Object
Returns the current time for comparing with entries TTL.
52 53 54 |
# File 'lib/elephas/backends/base.rb', line 52 def now ::Time.now.to_f end |
#read(key) ⇒ Entry|NilClass
Reads a value from the cache.
18 19 20 |
# File 'lib/elephas/backends/base.rb', line 18 def read(key) unimplemented end |
#write(key, value, options = {}) ⇒ Object
Writes a value to the cache.
29 30 31 |
# File 'lib/elephas/backends/base.rb', line 29 def write(key, value, = {}) unimplemented end |