Class: Faraday::HttpCache::MemoryStore

Inherits:
Object
  • Object
show all
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

Constructor Details

#initializeMemoryStore

Returns a new instance of MemoryStore.



128
129
130
# File 'lib/faraday/http_cache/storage.rb', line 128

def initialize
  @cache = {}
end

Instance Method Details

#read(key) ⇒ Object



132
133
134
# File 'lib/faraday/http_cache/storage.rb', line 132

def read(key)
  @cache[key]
end

#write(key, value) ⇒ Object



136
137
138
# File 'lib/faraday/http_cache/storage.rb', line 136

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