---2049402039-1415609092-11543038153048 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-1415609092-1154303815=:13048" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-1415609092-11543038153048 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Mon, 31 Jul 2006, Sche Daniel wrote: > By the way, what if I create > > class Q > @x=1 > end > > to whom does @x belong now? > Does it make sense? (Usually one wants to create with @@ class variables at > this scope) I actually have no memory of ever having wanted to use a class variable in Ruby :-) But anyway... see Florian's answer; but I just wanted to add, as a general rule: Whenever you see @var, you are seeing an instance variable that belongs to whatever object, at that point in execution, is "self". Thus the answer to "What object does @var belong to?" is always the same: self. So at the top level of a class definition, where self is the class object, @var will belong to the class object. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc. ---2049402039-1415609092-11543038153048-- ---2049402039-1415609092-11543038153048--