Class: Lumber::LevelUtil::MemoryCacheProvider
- Inherits:
-
Object
- Object
- Lumber::LevelUtil::MemoryCacheProvider
- Defined in:
- lib/lumber/level_util.rb
Instance Method Summary collapse
-
#initialize ⇒ MemoryCacheProvider
constructor
A new instance of MemoryCacheProvider.
- #read(key) ⇒ Object
- #write(key, value, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ MemoryCacheProvider
Returns a new instance of MemoryCacheProvider.
14 15 16 |
# File 'lib/lumber/level_util.rb', line 14 def initialize @cache = {} end |
Instance Method Details
#read(key) ⇒ Object
18 19 20 |
# File 'lib/lumber/level_util.rb', line 18 def read(key) @cache[key] end |
#write(key, value, options = {}) ⇒ Object
22 23 24 |
# File 'lib/lumber/level_util.rb', line 22 def write(key, value, ={}) @cache[key] = value end |