From: Christoph Date: 2005-04-25T12:22:33+09:00 Subject: Re: Strange behavior with SimpleDelegator and its Idioclass Trans schrieb: >Perhaps I should point out that the strange thing about this is that >when the #bracket method in SD is NOT defined, then the module included >in the idioclass (singleton) is not called as one would expect it to >be. But when you add #bracket into SD, it "suddenly" works as it >should, and subsequently by passes the #bracket method just defined! > > You really have to look at the source code in delegator.rb. Instantiation creates a singleton method for all forwarded methods - However some methods are not forwarded (preserved) for example when they already defined in the Delegator sub class. Now combine this with the following behavior --- module A def foo "subordinate" end end class << a = Object.new def foo "dominate" end include A end p a.foo # dominate -- and you have your explanation /Christoph