Class R10K::InstanceCache
In: lib/r10k/instance_cache.rb
Parent: Object

This class implements a generic object memoization container. It caches new objects and returns cached objects based on the instantiation arguments.

Methods

clear!   generate   new  

Public Class methods

Initialize a new registry with a given class

@param klass [Class] The class to memoize @param method [Symbol] The method name to use when creating objects.

                       Defaults to :new.

Public Instance methods

Clear all memoized objects

Create a new object, or return a memoized object.

@param args [*Object] The arguments to pass to the initialize method

@return [Object] A memoized instance of the registered class

[Validate]