Class: Rack::Cache::MetaStore::MEM

### Home Classes Methods

### In Files

- lib/rack/cache/metastore.rb

### Parent

Rack::Cache::MetaStore

### Methods

- ::new
- ::resolve
- #purge
- #read
- #to_hash
- #write

### Files

- CHANGES
- COPYING
- README
- TODO

### Class/Module Index

Quicksearch

- Rack
- Rack::Cache
- Rack::Cache::AppEngine
- Rack::Cache::AppEngine::MC
- Rack::Cache::AppEngine::MemCache
- Rack::Cache::CacheControl
- Rack::Cache::Context
- Rack::Cache::EntityStore
- Rack::Cache::EntityStore::DISK
- Rack::Cache::EntityStore::Dalli
- Rack::Cache::EntityStore::Disk
- Rack::Cache::EntityStore::FILE
- Rack::Cache::EntityStore::GAE
- Rack::Cache::EntityStore::GAECACHE
- Rack::Cache::EntityStore::GAEStore
- Rack::Cache::EntityStore::HEAP
- Rack::Cache::EntityStore::Heap
- Rack::Cache::EntityStore::MEM
- Rack::Cache::EntityStore::MemCacheBase
- Rack::Cache::EntityStore::MemCached
- Rack::Cache::Key
- Rack::Cache::MetaStore
- Rack::Cache::MetaStore::DISK
- Rack::Cache::MetaStore::Dalli
- Rack::Cache::MetaStore::Disk
- Rack::Cache::MetaStore::FILE
- Rack::Cache::MetaStore::GAE
- Rack::Cache::MetaStore::GAECACHE
- Rack::Cache::MetaStore::GAEStore
- Rack::Cache::MetaStore::HEAP
- Rack::Cache::MetaStore::Heap
- Rack::Cache::MetaStore::MEM
- Rack::Cache::MetaStore::MemCacheBase
- Rack::Cache::MetaStore::MemCached
- Rack::Cache::Options
- Rack::Cache::Request
- Rack::Cache::Response
- Rack::Cache::Storage

No matching classes.

# Rack::Cache::MetaStore::MEM

Concrete MetaStore implementation that uses a simple Hash to store request/response pairs on the heap.

### Public Class Methods

new(hash={}) click to toggle source

    # File lib/rack/cache/metastore.rb, line 178
    def initialize(hash={})
      @hash = hash
    end

resolve(uri) click to toggle source

    # File lib/rack/cache/metastore.rb, line 203
    def self.resolve(uri)
      new
    end

### Public Instance Methods

purge(key) click to toggle source

    # File lib/rack/cache/metastore.rb, line 194
    def purge(key)
      @hash.delete(key)
      nil
    end

read(key) click to toggle source

    # File lib/rack/cache/metastore.rb, line 182
    def read(key)
      if data = @hash[key]
        Marshal.load(data)
      else
        []
      end
    end

to_hash() click to toggle source

    # File lib/rack/cache/metastore.rb, line 199
    def to_hash
      @hash
    end

write(key, entries) click to toggle source

    # File lib/rack/cache/metastore.rb, line 190
    def write(key, entries)
      @hash[key] = Marshal.dump(entries)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.