Class: LockBoxCache::Cache::HashCache
- Inherits:
-
Object
- Object
- LockBoxCache::Cache::HashCache
- Defined in:
- lib/lockbox_cache.rb
Instance Method Summary collapse
- #delete(key) ⇒ Object
-
#initialize ⇒ HashCache
constructor
A new instance of HashCache.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ HashCache
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 |