Hi, I'm Bruce Williams.

Forward and Delegate, A Simple Pattern (2007-08-11)

Here’s a simple example showing how to:
  1. Forward all missing method invocations on to some @object
  2. Dynamically add delegation of that method to that object for future invocations
<notextile>
def method_missing(meth, *args, &block) #:nodoc:
  returning @object.__send__(meth, *args, &block) do
    self.class.class_eval %{delegate :#{meth}, :to => :@object}
  end
end
</notextile>
Note this example uses two bits from ActiveSupport:

Enjoy!