Class: ActionDispatch::RailsEntityStore
- Inherits:
-
Rack::Cache::EntityStore
- Object
- Rack::Cache::EntityStore
- ActionDispatch::RailsEntityStore
- Defined in:
- actionpack/lib/action_dispatch/http/rack_cache.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Boolean) exist?(key)
-
- (RailsEntityStore) initialize(store = RAILS_CACHE)
constructor
A new instance of RailsEntityStore.
- - (Object) open(key)
- - (Object) read(key)
- - (Object) write(body)
Constructor Details
- (RailsEntityStore) initialize(store = RAILS_CACHE)
A new instance of RailsEntityStore
36 37 38 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 36 def initialize(store = RAILS_CACHE) @store = store end |
Class Method Details
+ (Object) resolve(uri)
32 33 34 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 32 def self.resolve(uri) new end |
Instance Method Details
- (Boolean) exist?(key)
40 41 42 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 40 def exist?(key) @store.exist?(key) end |
- (Object) open(key)
44 45 46 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 44 def open(key) @store.read(key) end |
- (Object) read(key)
48 49 50 51 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 48 def read(key) body = open(key) body.join if body end |
- (Object) write(body)
53 54 55 56 57 58 |
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 53 def write(body) buf = [] key, size = slurp(body) { |part| buf << part } @store.write(key, buf) [key, size] end |