Class: LockBoxCache::Cache::HashCache

Inherits:
Object
  • Object
show all
Defined in:
lib/lockbox_cache.rb

Instance Method Summary collapse

Constructor Details

#initializeHashCache

Returns a new instance of HashCache.



9
10
11
# File 'lib/lockbox_cache.rb', line 9

def initialize
  @store = Hash.new
end

Instance Method Details

#clearObject



25
26
27
# File 'lib/lockbox_cache.rb', line 25

def clear
  @store = {}
end

#delete(key) ⇒ Object



21
22
23
# File 'lib/lockbox_cache.rb', line 21

def delete(key)
  @store.delete(key)
end

#read(key) ⇒ Object



17
18
19
# File 'lib/lockbox_cache.rb', line 17

def read(key)
  @store[key]
end

#write(key, value) ⇒ Object



13
14
15
# File 'lib/lockbox_cache.rb', line 13

def write(key, value)
  @store[key] = value
end