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)
-
- (TrueClass|FalseClass) delete(key)
Deletes a value from the cache.
-
- (TrueClass|FalseClass) exists?(key)
Checks if a key exists in the cache.
-
- (Object) now
Returns the current time for comparing with entries TTL.
-
- (Entry|NilClass) read(key)
Reads a value from the cache.
-
- (Object) write(key, value, options = {})
Writes a value to the cache.
Instance Method Details
- (TrueClass|FalseClass) delete(key)
Deletes a value from the cache.
37 38 39 |
# File 'lib/elephas/backends/base.rb', line 37 def delete(key) unimplemented end |
- (TrueClass|FalseClass) exists?(key)
Checks if a key exists in the cache.
45 46 47 |
# File 'lib/elephas/backends/base.rb', line 45 def exists?(key) unimplemented end |
- (Object) now
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 |
- (Entry|NilClass) read(key)
Reads a value from the cache.
18 19 20 |
# File 'lib/elephas/backends/base.rb', line 18 def read(key) unimplemented end |
- (Object) write(key, value, options = {})
Writes a value to the cache.
29 30 31 |
# File 'lib/elephas/backends/base.rb', line 29 def write(key, value, = {}) unimplemented end |