Class: Microengine::MemoryCache
- Defined in:
- lib/memory_cache.rb
Overview
Load pages to memory and return it on requests
Instance Attribute Summary
Attributes inherited from FileCache
Instance Method Summary collapse
-
#get(path, lang) ⇒ Object
Return XHTML page content.
-
#initialize ⇒ MemoryCache
constructor
A new instance of MemoryCache.
-
#refresh ⇒ Object
Refresh cache.
Constructor Details
#initialize ⇒ MemoryCache
Returns a new instance of MemoryCache.
24 25 26 27 |
# File 'lib/memory_cache.rb', line 24 def initialize @cache = {} super end |
Instance Method Details
#get(path, lang) ⇒ Object
Return XHTML page content
36 37 38 |
# File 'lib/memory_cache.rb', line 36 def get(path, lang) @cache[path][lang] end |
#refresh ⇒ Object
Refresh cache
30 31 32 33 |
# File 'lib/memory_cache.rb', line 30 def refresh @cache = {} super end |