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.
13 14 15 16 |
# File 'lib/relaton/render/template/template.rb', line 13 def initialize @cache = {} @mutex = Mutex.new end |
Instance Attribute Details
#mutex ⇒ Object
Returns the value of attribute mutex.
11 12 13 |
# File 'lib/relaton/render/template/template.rb', line 11 def mutex @mutex end |
Instance Method Details
#clear ⇒ Object
26 27 28 |
# File 'lib/relaton/render/template/template.rb', line 26 def clear @cache.clear end |
#retrieve(key) ⇒ Object
22 23 24 |
# File 'lib/relaton/render/template/template.rb', line 22 def retrieve(key) @cache[key] end |
#store(key, value) ⇒ Object
18 19 20 |
# File 'lib/relaton/render/template/template.rb', line 18 def store(key, value) @cache[key] = value end |