From: "Ara.T.Howard" Date: 2005-10-14T08:45:28+09:00 Subject: Re: Challenging Project ... Need a deep guru to provide enlightenment. On Fri, 14 Oct 2005, Ara.T.Howard wrote: > this'll be a good start: scratch that - try this: harp:~ > cat a.rb module Proxy def self::new obj klass = Class::new do ignore = %w( __send__ __id__ ) obj.class.instance_methods.each do |m| next if ignore.include? m module_eval <<-code def #{ m } *a, &b __obj.send "#{ m }", *a, &b end code end attr_accessor '__obj' def initialize obj self.__obj = obj end self end klass::new obj end end a = String::new 'forty-two' b = Proxy::new a p a.class p b.class p(a.methods == b.methods) p b.upcase harp:~ > ruby a.rb String String true "FORTY-TWO" -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================