From: Austin Ziegler Date: 2005-10-11T22:17:01+09:00 Subject: Re: extend and super -- I cannot understand why this behavior On 10/10/05, TRANS wrote: > module Q > module H > def x ; @x ||= [] ; end > end > extend H > end > > class R > include Q > extend Q::H > def self.x ; @x ||= [] ; ancestors[1].x + @x ; end > def self.x! ; @x ||= [] ; end > end > > Which I was mistakingly thinking that's what super would do. Why? Instance variables are in the class, not the module. So, when Q::H refers to @x, it's referring to @x in the class that has included or extended itself with Q::H. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca