Hello nobu,

Thursday, December 19, 2002, 9:21:52 AM, you wrote:
>> >> Finally (and I'm sure I should know this one already), how would I call
>> >> Object#to_s on foo if I have already redefined to_s?  (Is this even
>> >> possible?)
>> 
>> nnsn> Impossible outside redefined to_s, unless it's aliased.
>> 
>> if Ruby will call some method before adding each method, it will be possible

nnsn> Unfortunately, such hooks are only Class#method_added and so
nnsn> on, which will be called after it.

class Class
  def method_added
    puts "sorry, it's too late to save prevous method definition"
    puts "... but i can save the current definition for future references"
    puts "... are you sure you are absolutely need to do IT?"
    if gets=="y"
       $secret_hash[class][method] << method_definition
    end
  end
end

classes.each { |class|
  class.methods.each { |method|
    $secret_hash[class][method] << method_definition
  }
}


-- 
Best regards,
 Bulat                            mailto:bulatz / integ.ru