= Description A method that speeds methods up at the cost of memory. = Prerequisites Ruby 1.8.0 or later = Installation == Standard Installation ruby test/tc_memoize.rb (optional) ruby install.rb == Gems Installation ruby test/tc_memoize.rb (optional) ruby memoize.gemspec gem install memoize-xyz.gem # Where 'xyz' is the version = Synopsis require "memoize" include Memoize # Inefficient fibonacci method def fib(n) return n if n < 2 fib(n-1) + fib(n-2) end fib(100) # Slow memoize(:fib) fib(100) # Fast = Constants Memoize::MEMOIZE_VERSION Returns the version of this package as a String. = Methods Memoize.memoize(method) Takes a method (symbol) and caches the results of +method+ in a hash table. If you call +method+ again with the same arguments, memoize gives you the value from the table instead of letting the method compute the value again. = Acknowledgements Code borrowd from Nobu Nakada (ruby-talk:155159). == License Ruby's == Copyright (C) 2005, Daniel J. Berger All Rights Reserved = Author Daniel J. Berger djberg96@gmail.com IRC nick: imperator (freenode)