Class: CompEx::Cache
- Inherits:
-
Object
- Object
- CompEx::Cache
- Defined in:
- lib/compex/cache.rb,
lib/compex/cache/memory_backend.rb
Defined Under Namespace
Classes: MemoryBackend
Class Method Summary collapse
Class Method Details
.backend ⇒ Object
10 |
# File 'lib/compex/cache.rb', line 10 def backend = CompEx.config.cache_backend |
.cache_asset(key, value) ⇒ Object
12 13 14 |
# File 'lib/compex/cache.rb', line 12 def cache_asset(key, value) backend.set(prefix(key), value) end |
.get_asset(key) ⇒ Object
16 17 18 |
# File 'lib/compex/cache.rb', line 16 def get_asset(key) backend.get(prefix(key)) end |
.prefix(key) ⇒ Object
20 21 22 |
# File 'lib/compex/cache.rb', line 20 def prefix(key) "#{CompEx.config.cache_prefix}#{key}" end |