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.



23
24
25
# File 'lib/lockbox_cache.rb', line 23

def initialize
  @store = Hash.new
end

Instance Method Details

#delete(key) ⇒ Object



35
36
37
# File 'lib/lockbox_cache.rb', line 35

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

#read(key) ⇒ Object



31
32
33
# File 'lib/lockbox_cache.rb', line 31

def read(key)
  @store[key]
end

#write(key, value) ⇒ Object



27
28
29
# File 'lib/lockbox_cache.rb', line 27

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