Class: Jamnagar::Storage::InMemoryCache

Inherits:
Object
  • Object
show all
Defined in:
lib/jamnagar/storage/in_memory_cache.rb

Instance Method Summary collapse

Constructor Details

#initializeInMemoryCache

Returns a new instance of InMemoryCache.



4
5
6
# File 'lib/jamnagar/storage/in_memory_cache.rb', line 4

def initialize
  @cache = {}
end

Instance Method Details

#get(key) ⇒ Object



8
9
10
# File 'lib/jamnagar/storage/in_memory_cache.rb', line 8

def get(key)
  @cache[key]
end

#set(key, value) ⇒ Object



12
13
14
# File 'lib/jamnagar/storage/in_memory_cache.rb', line 12

def set(key, value)
  @cache[key] = value
end