From: Austin Ziegler Date: 2006-04-11T00:24:26+09:00 Subject: Re: Quick syntax question On 4/10/06, Gregory Seidman wrote:> Consider the following three class definitions:>> class Foo> def self.bar> @@bar> end> def self.bar=(val)> @@bar = val> end> end>> class Foo> class << self> def bar> @@bar> end> def bar=(val)> @@bar = val> end> end> end>> class Foo> class << self> attr_accessor :bar> end> end>> Am I correct in believing that they are equivalent? If not, how do they> differ? They are not equivalent. The first two are the same, but the thirdwill be accessing @bar, not @@bar. (Try it in IRB and you'll see.) -austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca