Class: Lev::MemoryStore

Inherits:
Object show all
Defined in:
lib/lev/memory_store.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryStore

Returns a new instance of MemoryStore.



4
5
6
# File 'lib/lev/memory_store.rb', line 4

def initialize
  @store = {}
end

Instance Method Details

#clearObject



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