class ActionDispatch::RailsEntityStore

Public Class Methods

new(store = Rails.cache) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 35
def initialize(store = Rails.cache)
  @store = store
end
resolve(uri) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 31
def self.resolve(uri)
  new
end

Public Instance Methods

exist?(key) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 39
def exist?(key)
  @store.exist?(key)
end
open(key) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 43
def open(key)
  @store.read(key)
end
read(key) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 47
def read(key)
  body = open(key)
  body.join if body
end
write(body) click to toggle source
# File lib/action_dispatch/http/rack_cache.rb, line 52
def write(body)
  buf = []
  key, size = slurp(body) { |part| buf << part }
  @store.write(key, buf)
  [key, size]
end