Class: Jamnagar::Storage::InMemoryCache
- Inherits:
-
Object
- Object
- Jamnagar::Storage::InMemoryCache
- Defined in:
- lib/jamnagar/storage/in_memory_cache.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize ⇒ InMemoryCache
constructor
A new instance of InMemoryCache.
- #set(key, value) ⇒ Object
Constructor Details
#initialize ⇒ InMemoryCache
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 |