From: Dale Martenson Date: 2008-05-20T08:00:03+09:00 Subject: Instance Variable in Mixins I am trying to get access to an instance variable. I have simplified my usage down to the following example. === start-of-code module A def A.a puts "A:#{@u}" end end module B def b puts "B:#{@u}" end end module C include A include B end class Blah include C def initialize(u) @u = u end def go A.a b end end blah = Blah.new("bob") blah.go === end-of-code My main question is that how can I get at the instance variable @u from within module A. I can use it fine from module B so I assume it is a namespace problem. It turns out that due to the way my mixins are used, I need to guard them against duplication. I guess I could use a prefix "def moduleA_a ... end" (El Yucko). I am using ruby 1.8.6. Thanks in advance, Dale