Module: Mize

Extended by:
Configure
Defined in:
lib/mize.rb,
lib/mize/memoize.rb,
lib/mize/railtie.rb,
lib/mize/version.rb,
lib/mize/configure.rb,
lib/mize/global_clear.rb

Defined Under Namespace

Modules: CacheMethods, Configure, Memoize, Reload Classes: DefaultCache, Railtie

Constant Summary collapse

MUTEX =
Mutex.new
VERSION =

Mize version

'0.3.3'
VERSION_ARRAY =

:nodoc:

VERSION.split('.').map(&:to_i)
VERSION_MAJOR =

:nodoc:

VERSION_ARRAY[0]
VERSION_MINOR =

:nodoc:

VERSION_ARRAY[1]
VERSION_BUILD =

:nodoc:

VERSION_ARRAY[2]
CacheProtocol =

The protocol the cache object has to conform to. This is a minimal subset of the ActiveSupport::Cache::Store protocol.

Protocol do
  # Clear the entire cache.
  def clear(options = nil)
  end

  # Returns true if the cache contains an entry for the given key.
  def exist?(name, options = nil)
  end

  # Fetches data from the cache, using the given key. If there is data in the
  # cache with the given key, then that data is returned. Otherwise, nil is
  # returned.
  def read(name, options = nil)
  end

  # Writes the value to the cache, with the key.
  def write(name, value, options = nil)
  end

  # Iterate over all cache entries and yield to their names.
  def each_name(&block)
  end

  # Return another cache instance that was correctly configured.
  def prototype
    dup
  end
end

Class Attribute Summary collapse

Attributes included from Configure

#default_cache

Class Method Summary collapse

Methods included from Configure

cache, configure

Class Attribute Details

.wrappedObject

Returns the value of attribute wrapped.



7
8
9
# File 'lib/mize.rb', line 7

def wrapped
  @wrapped
end

Class Method Details

.cache_clearObject

Clear all memoization caches at once.



5
6
7
# File 'lib/mize/global_clear.rb', line 5

def cache_clear
  each_cache(&:clear)
end