Class: Ey::Core::MemoryCache

Inherits:
Object
  • Object
show all
Defined in:
lib/ey-core/memory_cache.rb

Class Method Summary collapse

Class Method Details

.cacheObject



2
3
4
# File 'lib/ey-core/memory_cache.rb', line 2

def self.cache
  @cache ||= {}
end

.read(key) ⇒ Object



10
11
12
# File 'lib/ey-core/memory_cache.rb', line 10

def self.read(key)
  cache[key]
end

.reset!Object



6
7
8
# File 'lib/ey-core/memory_cache.rb', line 6

def self.reset!
  self.cache.clear
end

.write(key, value) ⇒ Object



14
15
16
# File 'lib/ey-core/memory_cache.rb', line 14

def self.write(key, value)
  cache[key] = value
end