From: "wbsurfver@..." Date: 2007-11-16T13:15:05+09:00 Subject: Re: instance variables as class variable ? Hi, Thanks for all the helpful comments, I will have a look at that site and study this some more. I kind of understand I think the gist of this. I do love Ruby and Rails to the point of almost an obsession, but my first impression of this particular instance question is that it seems sort of unintuitive at first pass anyway. When I first read about class and instance variables I thought I understood it until I saw some of these other types of examples. I wrote another test program below which prints the 2 different values of @x, I was out walking the dog thinking about this and I decided I needed to try this one example out to make sure I knew what it did, and I wasn't exactly sure what it was going to do until I tried it. #========================= class Test @x = 'frog' def initialize @x = "green" end def prx puts @x end class << self attr_accessor :x end end puts Test.x test = Test.new test.prx