Class: WebFetch::Storage::Memory
- Inherits:
-
Object
- Object
- WebFetch::Storage::Memory
- Defined in:
- lib/web_fetch/storage/memory.rb
Class Attribute Summary collapse
-
.storage ⇒ Object
readonly
Returns the value of attribute storage.
Instance Method Summary collapse
Class Attribute Details
.storage ⇒ Object (readonly)
Returns the value of attribute storage.
9 10 11 |
# File 'lib/web_fetch/storage/memory.rb', line 9 def storage @storage end |
Instance Method Details
#clear ⇒ Object
12 13 14 |
# File 'lib/web_fetch/storage/memory.rb', line 12 def clear self.class.storage.clear end |
#delete(key) ⇒ Object
24 25 26 |
# File 'lib/web_fetch/storage/memory.rb', line 24 def delete(key) storage.delete(key) end |
#fetch(key) ⇒ Object
20 21 22 |
# File 'lib/web_fetch/storage/memory.rb', line 20 def fetch(key) storage.fetch(key, nil) end |
#store(key, obj) ⇒ Object
16 17 18 |
# File 'lib/web_fetch/storage/memory.rb', line 16 def store(key, obj) storage[key] = obj end |