From: rak rok Date: 2006-07-27T09:16:12+09:00 Subject: Issue extending a delegated class ------=_Part_29703_248561.1153959367618 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I have a simple class that I'm extending via delegation: class A def one ; puts "A::one" ; two ; end def two ; puts "A::two" ; end end class B < SimpleDelegator def initialize a = A.new # do some stuff to a __setobj__ a super( a ) end end I then instantiate B, and use that, all is well. However, i'm running into issues whenever I try to override a method in B: b = B.new class << b def two ; puts "foo" ; end end I would have expected b.one to output: A::one custom But instead i get: A::one A::two However, calling the overriden method directly produces the expected result. I'm guessing the extend is really only adding the function to the B instance and not to A? Is there a way to get to A? Thanks, -rak- ------=_Part_29703_248561.1153959367618--