From: Ruby Admirer Date: 2007-03-02T00:03:06+09:00 Subject: Re: How to get modules included by a class/module (not those from the superclasses) --0-1230221221-1172761380=:19970 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit >This has changed in 1.9 (or at least as of a few months ago which was the last time I built 1.9) > >rick@frodo:~$ cat modtest.rb >module M >end > >class P >include M >end > >class C < P >end > >p C.ancestors > >class C >include M >end > >p C.ancestors > >rick@frodo:~$ ruby1.8 modtest.rb >[C, P, M, Object, Kernel] >[C, P, M, Object, Kernel] >rick@frodo:~$ ruby1.9 modtest.rb >[C, P, M, Object, Kernel, BasicObject] >[C, M, P, M, Object, Kernel, BasicObject] > Thanks for your reply. This is what I expected as this is consistent with the new class var/methods behaviour. >I wrote about this back in October >http://talklikeaduck.denhaven2.com/articles/2006/10/09/a-subtle-change-to-mixin-semantics-in-ruby-1-9 Oups ! I just created a new thread on this subject. Maybe we will get some official/more up to date position as I haven't found any mention on this change on the report from EigenClass "Changes of Ruby 1.9 update 6". Chauk-Mean. --------------------------------- Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers. --0-1230221221-1172761380=:19970--