Class: Relaton::Render::Template::CacheManager
- Inherits:
-
Object
- Object
- Relaton::Render::Template::CacheManager
- Includes:
- Singleton
- Defined in:
- lib/relaton/render/template/template.rb
Instance Attribute Summary collapse
-
#mutex ⇒ Object
Returns the value of attribute mutex.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ CacheManager
constructor
A new instance of CacheManager.
- #retrieve(key) ⇒ Object
- #store(key, value) ⇒ Object
Constructor Details
#initialize ⇒ CacheManager
Returns a new instance of CacheManager.
17 18 19 20 |
# File 'lib/relaton/render/template/template.rb', line 17 def initialize @cache = {} @mutex = Mutex.new end |
Instance Attribute Details
#mutex ⇒ Object
Returns the value of attribute mutex.
12 13 14 |
# File 'lib/relaton/render/template/template.rb', line 12 def mutex @mutex end |
Instance Method Details
#clear ⇒ Object
30 31 32 |
# File 'lib/relaton/render/template/template.rb', line 30 def clear @cache.clear end |
#retrieve(key) ⇒ Object
26 27 28 |
# File 'lib/relaton/render/template/template.rb', line 26 def retrieve(key) @cache[key] end |
#store(key, value) ⇒ Object
22 23 24 |
# File 'lib/relaton/render/template/template.rb', line 22 def store(key, value) @cache[key] = value end |