Class: Relaton::Render::Template::CacheManager

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/relaton/render/template/template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCacheManager

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

#mutexObject

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

#clearObject



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