Class: Microengine::MemoryCache

Inherits:
FileCache show all
Defined in:
lib/memory_cache.rb

Overview

Load pages to memory and return it on requests

Instance Attribute Summary

Attributes inherited from FileCache

#langs

Instance Method Summary collapse

Constructor Details

#initializeMemoryCache

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

#refreshObject

Refresh cache



30
31
32
33
# File 'lib/memory_cache.rb', line 30

def refresh
  @cache = {}
  super
end