Class: ActionDispatch::RailsMetaStore

Inherits:
Rack::Cache::MetaStore
  • Object
show all
Defined in:
actionpack/lib/action_dispatch/http/rack_cache.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (RailsMetaStore) initialize(store = Rails.cache)



11
12
13
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 11

def initialize(store = Rails.cache)
  @store = store
end

Class Method Details

+ (Object) resolve(uri)



7
8
9
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 7

def self.resolve(uri)
  new
end

Instance Method Details

- (Object) read(key)



15
16
17
18
19
20
21
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 15

def read(key)
  if data = @store.read(key)
    Marshal.load(data)
  else
    []
  end
end

- (Object) write(key, value)



23
24
25
# File 'actionpack/lib/action_dispatch/http/rack_cache.rb', line 23

def write(key, value)
  @store.write(key, Marshal.dump(value))
end