Sha256: 8808f17aae86a35c7ea3e375ff252b2fd559eeb00512798fec1cc11978f65dd0

Contents?: true

Size: 432 Bytes

Versions: 4

Compression:

Stored size: 432 Bytes

Contents

module Restfulie::Client::HTTP

  module Cache

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

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

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

  end

  class RequestBuilderExecutorWithCache < RequestBuilderExecutor
    include Cache
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
restfulie-0.8.0 lib/restfulie/client/http/cache.rb
restfulie-0.7.2 lib/restfulie/client/http/cache.rb
restfulie-0.7.1 lib/restfulie/client/http/cache.rb
restfulie-0.7.0 lib/restfulie/client/http/cache.rb