From: Simen Date: 2006-05-03T03:31:40+09:00 Subject: Re: Mixin Syntax for Newbies Nathan Olberding wrote: > Simen wrote: >> In the above code, @one is actually an instance variable of module One: >> >> One.instance_variable_get "@one" >> # => "One!" > > Okay, that makes sense. In that case, is it possible to have instance > variables for classes defined in modules which they mix in? If you make it a method, you can call it from initialize: module One def one; @one = "One!"; end end class Two def initialize one puts @one end end # Outputs "One!" two = Two.new -- Posted via http://www.ruby-forum.com/.