hacks/lazy_evaluator |
class LazyEvaluator < KernellessObject |
The LazyEvaluator will then call the block it was initialized with, swap itself (using Object#become) with the return value of the block, and then will call the intended method.
The object returned from the block will become the LazyEvaluator. This is important, as it means you should never store a reference to that object, or you may get unexpected results.
Example:
l = LazyEvaluator.new { Object.new }
p l #=> #
Public Methods |