Class: Lev::MemoryStore
Instance Method Summary collapse
- #clear ⇒ Object
- #fetch(key) ⇒ Object
-
#initialize ⇒ MemoryStore
constructor
A new instance of MemoryStore.
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ MemoryStore
Returns a new instance of MemoryStore.
4 5 6 |
# File 'lib/lev/memory_store.rb', line 4 def initialize @store = {} end |
Instance Method Details
#clear ⇒ Object
16 17 18 |
# File 'lib/lev/memory_store.rb', line 16 def clear @store.clear end |
#fetch(key) ⇒ Object
8 9 10 |
# File 'lib/lev/memory_store.rb', line 8 def fetch(key) @store[key] end |
#write(key, value) ⇒ Object
12 13 14 |
# File 'lib/lev/memory_store.rb', line 12 def write(key, value) @store[key] = value end |