The memoize library allows you to cache methods for Numerics (Integer/Float) in Ruby >= 2.0.0.
antimon2
MIT