From: Christoph Date: 2005-04-25T10:36:30+09:00 Subject: Re: Strange behavior with SimpleDelegator and its Idioclass Trans schrieb: >Have a look at this. Run it as is, then unremark the comment section. >Something strange is a foot here. > > Brownings the source of the Delegator.rb is becomes clear that it is not mend to be deal with this kind of abuse - also your example is obscured by a superfluous block usage. >require 'delegate' > >M = Module.new { > def bracket > p "come on" > end > > module M def bracket p "come on" end end >class SD < SimpleDelegator > > def initialize( obj ) > super( obj ) > s = (class << self ; self ; end) > s.class_eval { include M } > replace the last two lines with extend M /Christoph