Memoizer

DESCRIPTION

Memoizer wraps objects to provide cached method calls.

RELEASE NOTES

Please see RELEASE file.

SYNOPSIS

  require 'memoizer'

  class X
    def initialize ; @tick = 0 ; end
    def tick; @tick + 1; end
    def memo; @memo ||= Memoizer.new(self) ; end
  end

  x = X.new
  x.tick       #=> 1
  x.memo.tick  #=> 2
  x.tick       #=> 3
  x.memo.tick  #=> 2
  x.tick       #=> 4
  x.memo.tick  #=> 2

REFERENCE

In the future, the library might be improved by considering javathink.blogspot.com/2008/09/what-is-memoizer-and-why-should-you.html

HOW TO INSTALL

To install with RubyGems simply open a console and type:

  gem install memoizer

Local installation requires Setup.rb (gem install setup), then download the tarball package and type:

  tar -xvzf memoizer-1.0.0.tgz
  cd memoizer-1.0.0.tgz
  sudo setup.rb all

Windows users use ‘ruby setup.rb all’.

LEGAL NOTICE

Copyright © 2009 The Coding Dead Copyright © 2006 Erik Veenstra

This program is ditributed unser the terms of the LGPL v3 license.

See LICENSE file for details.

Files

Classes/Modules

Methods

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.