Module: Restfulie::Client::HTTP::Cache

Included in:
RequestBuilderExecutorWithCache
Defined in:
lib/restfulie/client/http/cache.rb

Instance Method Summary collapse

Instance Method Details

#getObject



9
10
11
12
13
# File 'lib/restfulie/client/http/cache.rb', line 9

def get
  store.fetch(@uri) do
    request(:get, @uri, @headers)
  end
end

#headObject



15
16
17
18
19
# File 'lib/restfulie/client/http/cache.rb', line 15

def head
  store.fetch(@uri) do
    request(:head, @uri, @headers)
  end
end

#storeObject



5
6
7
# File 'lib/restfulie/client/http/cache.rb', line 5

def store
  @store || @store = ::ActiveSupport::Cache::MemoryStore.new
end