From: Bertram Scharpf Date: 2005-03-25T09:18:52+09:00 Subject: Re: Understanding instance variables Hi, Am Donnerstag, 24. M�r 2005, 03:30:28 +0900 schrieb ts: > >>>>> "B" == Bertram Scharpf writes: > > B> class < > You are working with the singleton class (see what is the value of self > when you make the assignement to @x), use the singleton class > > B> puts c.instance_variables, c.instance_eval( '@x') > B> puts @x > > puts class < class <> c=class C ; self ; end.new >> s=class << C ; self ; end >> [c,s,C,Object].zip( %w-I S C O-).each { |x,y| x.instance_eval '@x='+y.inspect } >> [c,s,C,Object].collect { |x| x.instance_eval '@x' } => ["I", "S", "C", "O"] Or is there something I missed? Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de