Module: Elephas::Providers::Base
- Extended by:
- ActiveSupport::Concern
- Includes:
- Lazier::I18n
- Included in:
- Hash, RubyOnRails
- Defined in:
- lib/elephas/provider.rb
Overview
The base provider, with all methods a valid provider should override.
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.
39 40 41 |
# File 'lib/elephas/provider.rb', line 39 def delete(key) unimplemented end |
- (TrueClass|FalseClass) exists?(key)
Checks if a key exists in the cache.
47 48 49 |
# File 'lib/elephas/provider.rb', line 47 def exists?(key) unimplemented end |
- (Object) now
Returns the current time for comparing with entries TTL.
54 55 56 |
# File 'lib/elephas/provider.rb', line 54 def now ::Time.now.to_f end |
- (Entry|NilClass) read(key)
Reads a value from the cache.
20 21 22 |
# File 'lib/elephas/provider.rb', line 20 def read(key) unimplemented end |
- (Object) write(key, value, options = {})
Writes a value to the cache.
31 32 33 |
# File 'lib/elephas/provider.rb', line 31 def write(key, value, = {}) unimplemented end |