Borges::LRUCache (Class)

In: lib/Borges/Utilities/LRUCache.rb
Parent: Object

A least recently used cache

Methods

fetch   new   size   store  

Constants

DEFAULT_CAPACITY = 20
  The default capacity of the LRUCache.

Attributes

capacity  [RW]  The number of items the LRUCache can hold.

Public Class methods

Create a new LRUCache that can accomodate up to capacity objects.

Public Instance methods

Fetches key from the LRUCache.

Returns the number of items stored in the LRUCache.

Stores object in the cache, returning a key that can be used to retrive it.

[Validate]