Class: Faraday::HttpCache::MemoryStore
- Inherits:
-
Object
- Object
- Faraday::HttpCache::MemoryStore
- Defined in:
- lib/faraday/http_cache/storage.rb
Overview
Internal: A Hash based store to be used by the ‘Storage’ class when a ‘store’ is not provided for the middleware setup.
Instance Method Summary collapse
-
#initialize ⇒ MemoryStore
constructor
A new instance of MemoryStore.
- #read(key) ⇒ Object
- #write(key, value) ⇒ Object
Constructor Details
#initialize ⇒ MemoryStore
Returns a new instance of MemoryStore.
137 138 139 |
# File 'lib/faraday/http_cache/storage.rb', line 137 def initialize @cache = {} end |
Instance Method Details
#read(key) ⇒ Object
141 142 143 |
# File 'lib/faraday/http_cache/storage.rb', line 141 def read(key) @cache[key] end |
#write(key, value) ⇒ Object
145 146 147 |
# File 'lib/faraday/http_cache/storage.rb', line 145 def write(key, value) @cache[key] = value end |