Sha256: 44e4d4b9a6ae3d91fc95deba4c4469def0dc0c8c83c7e78fbc7c1438d6b9bca5

Contents?: true

Size: 544 Bytes

Versions: 13

Compression:

Stored size: 544 Bytes

Contents

module Restfulie
  module Client
    module 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
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 lib/restfulie/client/http/cache.rb
restfulie-1.1.1 lib/restfulie/client/http/cache.rb
restfulie-1.1.0 lib/restfulie/client/http/cache.rb
restfulie-nosqlite-1.0.3 lib/restfulie/client/http/cache.rb
restfulie-1.0.3 lib/restfulie/client/http/cache.rb
restfulie-1.0.0 lib/restfulie/client/http/cache.rb
restfulie-1.0.0.beta5 lib/restfulie/client/http/cache.rb
restfulie-1.0.0.beta4 lib/restfulie/client/http/cache.rb
restfulie-1.0.0.beta1 lib/restfulie/client/http/cache.rb
restfulie-0.1.0.beta1 lib/restfulie/client/http/cache.rb
restfulie-0.9.3 lib/restfulie/client/http/cache.rb
restfulie-0.9.1 lib/restfulie/client/http/cache.rb
restfulie-0.8.1 lib/restfulie/client/http/cache.rb